[Tutor] simple math but I can't quite get it

Charlie Derr charlie@webmind.com
Sat, 10 Feb 2001 18:13:54 -0500


>>> total = 0
>>> for j in range(0,len(a)):
...	  total+=a[j]

>>> print total


	hth,
		~c

~ -----Original Message-----
~ From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
~ michaelbaker@operamail.com
~ Sent: Saturday, February 10, 2001 12:24 AM
~ To: tutor@python.org
~ Subject: [Tutor] simple math but I can't quite get it
~ 
~ 
~ for a list of integers
~ a=[23,45,65,27,98]
~ how can I get the sum total of all integers in this list?
~ 
~ I just can't qutie make it on this one :(
~ thanks
~ 
~ 
~ _______________________________________________
~ Tutor maillist  -  Tutor@python.org
~ http://mail.python.org/mailman/listinfo/tutor