Sum of natural number in python

2022-12-30 00:21:53
Python 3 7daystreak hashnode
Sum of natural number in python

Example

Input
5
Output
15

Explanation

Program

range = int(input("enter the range"))
sum = 0 
for i in range(1,range+1):
  sum = sum + i 
print(sum)

© 2022 开源博客 京ICP备20030565号-2 Powered by Quick API team