Lists of lists traversal

Benjamin Dixon beatle at arches.uga.edu
Mon Dec 20 15:27:35 EST 1999


Hello, I am new to Python and am trying to figure out how I can iterate
over a list that I know to contain other lists of integers so that I can
add up the individual lists inside the larger list.

I tried things like this:

Sum(input):
	for x in input:
		value = 0
		for y in input:
			value = value + y
	return y

and other stuff but I'm not certain as to how to reference a specific
member of a given sublist.

Ben



More information about the Python-list mailing list