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

Daniel Crespo dcrespo at gmail.com
Fri Nov 18 14:02:40 EST 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?

Daniel




More information about the Python-list mailing list