Python语法: for循环
for迭代器循环
比while条件循环, 更适合循环取值
names = ["egon", "felix", "richard", "tom", "jack"]
count = 0
while count < len(names):
print(names[count])
count += 1
效果等同如下
names = ["egon", "felix", "richard", "tom", "jack"]
for x in names:
print(x)
for循环还可
原创
2020-07-24 16:55:59 ·
223 阅读 ·
0 评论