标签:lex class while ati for循环 coding 死循环 ora for
# -*- coding:utf-8 -*- # 循环打印列表. for循环 L1 = [11,22,33,"alex",] for i in L1: print("结果:",i) print("------ end ------") 结果: 11 结果: 22 结果: 33 结果: alex ------ end ------
# range # range(10) 相当于生成 0-9 的列表。 for i in range(10): print("结果:",i) print("------ end ------") 结果: 0 结果: 1 结果: 2 结果: 3 结果: 4 结果: 5 结果: 6 结果: 7 结果: 8 结果: 9 ------ end ------
while 和 for 的区别。while可以死循环,for 循环有边界!
标签:lex class while ati for循环 coding 死循环 ora for
原文地址:https://www.cnblogs.com/boc1023/p/9689324.html