On 06/05/15 15:01, Dave Angel wrote:

def adding_all(x):
     total = 0
     for num in x:
         total +=num
     return total

Good function.

Except for the fact that the built-in sum() function
does the same thing with a lot less typing...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to