02 Python 제어문 - (6) while

처어리·2024년 1월 18일

python

목록 보기
16/36
post-thumbnail

06. while

  • while 조건식 :
    실행문
count = 0
while count < 5:
    print(f"{count + 1}")
    count += 1
stop = 0
loop = True
while loop:
    stop += 1
    print(stop)
    if stop == 10:
        loop = False
print("- text 입력기(정지 : stop) -")
text = ''
while text != 'stop':
    text = input('>> ')
    print(text)
print('- End -')

0개의 댓글