Peter Otten wrote: > Daniel Crespo wrote: > > > How can I do > > > > new_variable = (variable) ? True : False; > > > > in Python in one line? > > new_variable = variable > > :-)
I would assume the OP is just lazy and don't want to type : new_variable = (variable_is_true_value) ? some_expression_when_variable_is_true_value is true : some_expression_when_variable_is_true_value is false rather than simple True/False. -- http://mail.python.org/mailman/listinfo/python-list