while
-
[Python Programming 기초] # 조건문과 반복문 2 : whileProgramming Language/Python 2020. 11. 18. 00:13
# 조건문과 반복문 2. while ex) a = [1, 10, 9, 24, 566] i = 0 # 인덱스 while i 1 10 9 24 566 - break : loop를 중단할 때 사용 ex) a = [1, 10, 9, 24, 25, 26] i = 0 while i 20: break print(a[i]) i += 1 => 1 10 9 - while True : 무한 루프 - continue : break처럼 loop를 빠져 나오진 않고, 다시 while 조건으로 점프 특정한 경우에 코드를 수행하지 않고 다음으로 건너 뛰기 위해 사용 ex) a = 7 while a > 0: a -= 1 if a == 5: c..