Answer to Question #2980 in Python for sarosh

Question #2980
Design a program in python with a loop that asks the user enter a series of positive numbers and display their sum.
1
Expert's answer
2011-06-06T07:45:03-0400
#!/usr/bin/python

n = input("Please enter the number of letters: ")
s = 0
for i in range(1,n+1):
print 'a[',i,']='
a=input()
s=s+a
print 'The total sum of all these numbers is ',s
#####################################################

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS