# Find the Sum of Natural Numbers in python
# we are taking a number from user as input
# entered value will be converted to int from string
num = int(input("Enter the number:"))
# we have used an if...else statement in a combination with a while loop to calculate the sum of natural numbers up to num
if num < 0:
print("Enter a positive number")
else:
sum = 0
# use while loop to iterate until zero
while(num > 0):
sum += num
num -= 1
print("The sum is", sum)