top of page

Sum of first n natural numbers in python


#Program By eboostup.com
# sum of first n natural numbers in python
i=1
sum=0
n=int(input("Enter the number"))
while i<=n:
    sum+=i
    i+=1
print("First",n,"natural number sum: ",sum)
print("Powered By eboostup")


bottom of page