x*x if x>10

ssecorp circularfunc at gmail.com
Sun Jul 27 08:13:36 EDT 2008


I have seen somewhere that you can write something like:

x*x if x>10

but exactly that doesn't work and I can't get any variation to work.

it is possible to nest with an else too.


how do you write it?


and also, is it idiomatic? doesn't seem to add functionality, just
another way of doing the same thing which is quite unpythonic but I
remember reading it was added because it helped simplify the
expression of a certain type of operation.



More information about the Python-list mailing list