Search the difference: Why this function defenition does'nt work?
h.jehadalwan at student.kun.nl
Sun Dec 23 10:08:49 CET 2001
> If you use a list index  that returns a single element of the type
> that that element is (which is what you want in this case). But when
> you use the colon for slice notation, you are asking python to return a
> tuple of all the elements up to the zeroth element, which is no
> elements--an empty tuple. Then you are trying to add a number to a
> tuple which is undefined.
But when I adjust the code to this:
it still does not work, despite the fact that sum is not an undefined
More information about the Python-list