Python program to Print Natural number 1 to N

#print 1 to n natural number
#using for loop
num=int(input("Please enter maxinmum number: "))
print("Natural numbers 1 to ",num )
for i in range(1,num+1):
     print i,

OUTPUT:

Enter maximum Natural number: 12
1 2 3 4 5 6 7 8 9 10 11 12

Leave a Comment