Confused: appending to a list
reply.in.the.newsgroup at my.address.is.invalid
Thu Mar 23 17:46:34 CET 2006
>I'm confused. Why is it that when I say "while len(list) < 5:", I get
>5 items in my list.
Because the last time when len(list) was < 5, the block of code following
the while executed and did something to the list to give it a length >= 5
(otherwise the block of code would be executed again and it wouldn't have
been the last time).
There you have it.
Wat wil jij leren? http://www.leren.nl
More information about the Python-list