You can use something like:
val = float(raw_input("Age: ")) status = ("working","retired")[val>65] print "You should be",status
although he is not very pythonic
(other parameters are closer to C / PERL, but this is due to more tuple magic)
Manuel Ferreria Mar 13 '09 at 18:24 2009-03-13 18:24
source share