1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| ll = [[111,222],[333,444],[555,6666]] for x,y in ll: print(x,y)
for x in [111,222,33,444,555]: if x == 33: break print(x)
for x in [111,222,33,444,555]: if x == 33: continue print(x)
for x in [111,222,33,444,555]: if x == 33: continue print(x) else: print('xxxxxxxxxxxxxxx')
ll = [111,222,33,444,555] for i in range(len(ll)): print(ll[i])
ll = [111,222,33,444,555] for i,v in enumerate(ll): print(i,v)
for i in range(3): print('=================>外层循环', i) for j in range(5): print("内层循环", j) """ =================>外层循环 0 内层循环 0 内层循环 1 内层循环 2 内层循环 3 内层循环 4 =================>外层循环 1 内层循环 0 内层循环 1 内层循环 2 内层循环 3 内层循环 4 =================>外层循环 2 内层循环 0 内层循环 1 内层循环 2 内层循环 3 内层循环 4 """
|