[Python] Sintassi.

Nicola Larosa nico a tekNico.net
Ven 20 Dic 2013 15:37:15 CET


Gabriele Battaglia wrote:
> Python 2.7.5.
> 
> Perchè la sintassi:
> 
> while not Menu():
> 
> funziona perfettamente, mentre invece:
> 
> while !Menu():
> 
> produce un errore?

Perchè "!" da solo non è un operatore, lo è solo insieme all'uguale:
"!=". Vedi

http://docs.python.org/2.7/reference/lexical_analysis.html#operators

e

http://docs.python.org/2.7/reference/expressions.html#unary-arithmetic-and-bitwise-operations

-- 
Nicola Larosa - http://www.tekNico.net/

You can live in a monogamous institution and you can negotiate monotony,
or you can live in a non-monogamous choice and negotiate jealousy. Pick
your evil. If you are opening it up you have to contend with the fact
that you're not the only one, and if you are not opening it up then
you have to contend with the fact that your partner is the only one.
 - Esther Perel, August 2013



Maggiori informazioni sulla lista Python