标签:class for def ber bcd print 遍历 两种 range
number = [0,1,2,3,5,7,8] for i in number: #第一种 print(i) for i in range(len(number)): #第二种 print(number[i]) str1 = ‘abcdefg‘ for j in str1: print(j) for j in range(len(str1)): print(str1[j])
输出:
0
1
2
3
5
7
8
0
1
2
3
5
7
8
a
b
c
d
e
f
g
a
b
c
d
e
f
g
标签:class for def ber bcd print 遍历 两种 range
原文地址:https://www.cnblogs.com/carlber/p/9895574.html