Nested for loop problem

Irmen de Jong irmen at
Sat Nov 8 23:42:39 CET 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?)


More information about the Python-list mailing list