How to do "new_variable = (variable) ? True : False; " (php) on python?

Daniel Crespo dcrespo at
Fri Nov 18 20:02:40 CET 2005

Hello to all,

How can I do

new_variable = (variable) ? True : False;

in Python in one line?

I want to do something like this:

dic = {'item1': (variable) ? True-part : False-part}

Any suggestions?


More information about the Python-list mailing list