how to print numbers from 1 to “n” in single line? «PYTHON 3»
Answers
Answered by
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
Math,
1 month ago
English,
1 month ago
Math,
3 months ago
English,
10 months ago
Business Studies,
10 months ago