write a program to find the sum of ' n ' natural numbers in python
Answers
Answered by
12
Answer:
hi...
Explanation:
n=int(input("enter the limit"))
sum=0
for i in range(n):
sum+=i
print(sum)
hope it helps you ☺️
Answered by
0
Answer:
Here we need to find the sum of n natural numbers in python. So what we need to do is read n natural numbers first. Then we need to add all of the n numbers using a loop preferably a for loop. Then we need to print the number.
The program should be like : -
n = int( input() )
q = []
max = 0
for i in range ( 10, n , 1 ) :
t = int ( input() )
q [i] = t
for i in range ( 10, n , 1 ) :
max = max + t
print(" Sum : ", max);
Similar References
brainly.in/question/9599693
brainly.in/question/6495944
#SPJ6
Similar questions