[Tutor] if statement

Alan Gauld alan.gauld at btinternet.com
Wed Nov 3 01:47:33 CET 2010


"Glen Clark" <glenuk at gmail.com> wrote 

> On a side note.. I didn't know you could do something like this:
> 
> x = z if ....

Yes it's python's equivalent to the C style 

foo = testVal() ? bar : baz

Also found in other languages (Java, Javascript, Perl?)

Alan G.



More information about the Tutor mailing list