Nested for loop problem

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Sat Nov 8 17:42:39 EST 2003


Don Low wrote:
>>>>for x in range(2, 2):
> 
> ...     print x
> ... 
> 
> Since x prints nothing, I guess x = NULL. If I try:

That's your misunderstanding. That loop does *nothing*,
it doesn't enter the loop body. When you're looping over
an empty sequence, the loop body is never entered.

(also, NULL is meaningless in Python. I think you meant
None, right?)

--Irmen





More information about the Python-list mailing list