What the fuck is with Python's [code]for loops[/code].
What's the difference between:
[code]
for i in list[0]:
for i in list[0:]:
for i in list[:0]:
[/code]
uh, well...
this isn't a loop question as much as it is a question about slicing. Read http://docs.python.org/tut/node5.html#SECTION005120000000000000000 for how that works.
we assume that the list is composed of objects that are sequences and thus can be iterated through.
the first statement uses i to iterate through the first or zeroth element
the second creates a slice from the first to the last, which is the whole list. by omitting the second offset, it gets interpreted as: from the zeroth element up to the len(list) or list[0:len(list)]
the third, another slice, is interpreted as list[0:0], which is the zeroth element
this seems correct, although i dont program in python (or any other language for that matter)
Smells like a homework question. Do it yourself.
This board is SLOOOOW