while 语句:
>>> x = 1 >>> while x < 5: ... x +=1 ... print(x) ... 2 3 4 5
for 语句:
>>> words = ['aaa','bbb', 'ccc'] >>> for word in words: ... print(word) ... aaa bbb ccc
2023-11-13 19:29:52
while 语句:
>>> x = 1 >>> while x < 5: ... x +=1 ... print(x) ... 2 3 4 5
for 语句:
>>> words = ['aaa','bbb', 'ccc'] >>> for word in words: ... print(word) ... aaa bbb ccc