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 that reads two numbers and an arithmetic operator and displays the computed result.

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