##### ► Python program to Find the Sum of Natural Numbers

Steps followed:
1. Take natural number range as input from user
2. validate the range
3. add numbers in the range using loop
4. print the result

Program
``````#Python program to Find the Sum of Natural Numbers

# Take natural number range as input from user
range_lower_value,range_upper_value = input("provide the range in format lowerrange,upper range ").split(",")

total=0
#validate the range
try:
range_lower_value = int(range_lower_value)
range_upper_value = int(range_upper_value)
if range_upper_value < range_lower_value:
print("invalid range")
else:
for i in range(range_lower_value,range_upper_value+1):
total=total+i
except:
print("range provided is invalid")

#printing the result
print('Sum of Natural Numbers in range %d and %d is %d' %(range_lower_value,range_upper_value,total))``````

Output
``````provide the range in format lowerrange,upper range 0,10
Sum of Natural Numbers in range 0 and 10 is 55

provide the range in format lowerrange,upper range 50,100
Sum of Natural Numbers in range 50 and 100 is 3825``````