Program to print all the natural numbers from 1 to n
Program to print all the natural numbers from 1 to n
a=input("Enter the number up to which to be printed : ")
n=0
for a in range(1,a+1):
print a
if n==a:
break
OUTPUT :
Enter the number up to which to be printed : 10
1
2
3
4
5
6
7
8
9
10
No comments