Daniel Crespo wrote: > Oh... Well, thanks for that information. > > I'll do this then: > > def TernaryOperation(condition,true_part,false_part): > if condition: > return True-part > else: > return False-part > > a = {'Huge': TernaryOperation(quantity>90,True,False)}
By the time it compiles it will do the same as a = {"Huge": quantity>90} Consider describing your actual problem and keep in mind that the "ternary operator" is a means, not an end. Peter -- http://mail.python.org/mailman/listinfo/python-list