#while문 : 조건이 참True인 동안 명령을 계속 반복
'''
기본형
while 조건:
    반복할 명령
'''

i = 3
while i > 0:
    print(i)
    i = i - 1
print('땡!')

a = 1
while a <= 5:
    print(a)
    a = a + 1

print('----문제1----')
battery = 100
while battery > 0:
    print('배터리 잔량:',battery,'%')
    battery = battery - 15  
print("전원이 꺼졌습니다")

print('----문제2----')
day = 1
while day <= 5:
    print(day, "일차: 총 당근", day * 3, "개")
    day = day + 1





Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: