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

William Perry wmperry@swbell.net
Sat, 10 Feb 2001 01:04:22 -0600


Is this what you meant?

================

def addum():
	ans=a[0]
	lst=a[1:]
	for i in lst:
		x=i+ans
	print x
================

*********** REPLY SEPARATOR  ***********

On 2/9/01 at 9:24 PM michaelbaker@operamail.com wrote:

>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