728x90
for
-
[Python tutorial] 13. Control flow, Loop, Iterator코딩/Python 2022. 12. 21. 17:15
While Loops i = 1 while i < 6: print(i) i += 1 break i = 1 while i < 6: print(i) if i == 3: break i += 1 continue i = 0 while i < 6: i += 1 if i == 3: continue print(i) else i = 1 while i < 6: print(i) i += 1 else: print("i is no longer less than 6") For Loop fruits = ["apple", "banana", "cherry"] for x in fruits: print(x) Looping Through a String for x in "banana": print(x) break fruits = ["app..