浅析python中while循环和for循环

(编辑:jimmy 日期: 2024/10/2 浏览:2)

while循环

只要循环条件为True(以下例子为x > y),while循环就会一直 执行下去:

u, v, x, y = 0, 0, 100, 30   "htmlcode">
item_list = [3, "string1", 23, 14.0, "string2", 49, 64, 70] 
for x in item_list:   "found an integer divisible by seven: %d" % x)    
break   "htmlcode">
found an integer divisible by seven: 49

上面就是关于while和for循环的全部知识点,感谢大家的学习和对的支持。