(python) while, break, continue - 반복문

berry ·2021년 7월 2일
0

Python

목록 보기
5/15
post-thumbnail

📌 while

while [조건문]

[수행문]

  • [조건문]의 조건이 True일 동안에만 while 안의 [수행문]이 반복 동작
    (그래서 반복문!)

기본 연산과 다르게 n<x여도 x까지가 포함이다


📌 while - break

while [조건문]

[수행문]

[특정조건문] :
break

  • 특정조건문의 조건에서 False가 되면 while문에서 나옴 (반복 break)

📌 while - continue

while [조건문]

[수행문]

[특정조건문] :
continue

  • 특정조건문의 조건에 True일 경우 continue,
    False일 경우 while 문 처음부터 다시 시작

profile
Engineer

0개의 댓글