본문 바로가기

Python_Matter/Solve

Python Learn the basics Quiz 31

반응형

Q>

자연수 N을 사용자에게 입력 받아 1부터 N까지 한 줄에 하나씩 출력하시오.


A>

num = int(input('N을 입력하세요 : '))

for i in range(1, num + 1):
print(i)


O>

N을 입력하세요 : 5

1

2

3

4

5


Process finished with exit code 0

반응형

'Python_Matter > Solve' 카테고리의 다른 글

Python Learn the basics Quiz 33  (0) 2019.05.12
Python Learn the basics Quiz 32  (0) 2019.05.12
Python Learn the basics Quiz 30  (0) 2019.05.02
Python Learn the basics Quiz 29  (0) 2019.04.30
Python Learn the basics Quiz 28  (0) 2019.04.26