Files
python-study/11. While.py
2021-04-26 20:40:14 +09:00

36 lines
426 B
Python

# while 반복문
i = 1
while i <= 10:
print("왓더 헬")
i += 1
# 1 ~ 100 수 중 짝수만 출력
i = 1
while i <= 100:
if i % 2 == 0:
print(i)
i += 1
i = 1
while i <= 50:
print(i * 2)
i += 1
# 100 이상의 자연수 중 가장 작은 23의 배수 출력
i = 100
while i:
if i % 23 == 0:
print(i)
break
i += 1
i = 100
while i % 23 != 0:
i += 1
print(i)