"""
Write a python program that takes an input from the user and then
prints numbers starting from 1 to the given input.
The output should be in one line. Use while loop.
Example 1
Sample Input: 10
Sample Output: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Example 2
Sample Input: 5
Sample Output: 1, 2, 3, 4, 5
"""
import math
while 1:
N = int(input())
if N > 0:
break
else:
print("The number must be positive")
k = 0
while k < N:
k = k + 1
print(str(k) + ",", end = " ")
Comments
Leave a comment