[Tutor] sum of a list

jason hochstein bigapple631 at optonline.net
Wed Aug 11 01:25:25 CEST 2004


I can't figure out or find anywhere how to get the sum of a list?? Here is what I have so far:

l_input=[]

while True:
    s = raw_input("Type number. Hit enter for more or type quit to finish: ")

   
    if s == "quit":
        break
    else:
         l_input.append(float(s))

print "Here is your list of numbers ", l_input

for i in l_input:
   

I am trying to get the sum of all numbers inputed so I can work with the the total.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040810/95df877e/attachment.htm


More information about the Tutor mailing list