Python 循环多少次

2025-04-29 12:44:57
推荐回答(1个)
回答1:

#例子
a=1
b=list(range(10))
for y in b:
    print(a,y)
    a+=1

#结果        
Connected to pydev debugger (build 141.2569)
1 0
2 1
3 2
4 3
5 4
6 5
7 6
8 7
9 8
10 9