program to print sum of natural numbers between 1 to 7.

Sum=0
For n in range(1,8):
         sum+=n
print("sum of natural numbers<=",n,'is',sum)

Output
Sum of natural numbers <= 7 is 28

Comments

Popular posts from this blog

program to find the multiples of a number ( the divisor) out of given five numbers.

program to display a menu for calculating area of a circle or perimeter of a circle.

program to test the divisibility of a number with another number.