Python Program to input any number(N) and print sum of 1 to N.


n=int(input('Enter Any Number ?'))

sum=0

for i in range(1,n+1):

    sum=sum+i

print(sum)

Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.