python3: 'where' keyword

Peter Hansen peter at engcorp.com
Sat Jan 8 12:53:05 EST 2005


Andrey Tatarinov wrote:
>  >>> print words[3], words[5] where:
>  >>>     words = input.split()
> 
> - defining variables in "where" block would restrict their visibility to 
> one expression

Then your example above doesn't work...  print takes a
sequence of expressions, not a tuple as you seem to think.

-Peter



More information about the Python-list mailing list