Computer Science, asked by krishnavyshakdev, 3 months ago

how to print numbers from 1 to “n” in single line? «PYTHON 3»​

Answers

Answered by FantomDX
1

# Python program to print numbers from 1 to n.

n = int(input("Please Enter any Number: "))

print("The List of Natural Numbers from 1", "to", n)

for i in range(1, n + 1): print (i, end = ' ')

or

for x in range(1,11):

   print(x, end=" ")

Similar questions