Write a program in python to find the sum of n natural numbers
------------------------------------
num=int(input("Enter the Limit : "))
s=0
for i in range(1,num+1):
s=s+i
print("The sum is : ",s)
------------------------------------
Output :-
Enter the Limit : 5
The sum is : 15
0 Comments