This is a Python Code to Print the Sum of 'n' Natural Number's in Python.
Source Code:
num = int(input("\n Enter a Number : "))
temp = num
sum = 0
while (num > 0):
sum += num
num -= 1
print(" The sum of '%d' is '%d'." % (temp, sum))
Program Output:
.....
Post a Comment