Christian Gollwitzer <aurio...@gmx.de>: > Am 15.01.16 um 21:24 schrieb Kitten Corner: >> print('i like pie' or 'i like donuts') > >> it only does the thing that's before the 'or', please help! > > I think you misunderstand what "or" does. It evaluates the first > expression, and if this is false, it evaluates the second.
The fact that "or" doesn't return True but one of its arguments is a great feature. Too bad "any" doesn't follow suit: >>> any(x for x in ('a', 'b')) True >>>> import random >>>> random.choice(('donuts','apples')) > 'donuts' Well, there's that. "Any" works more nicely with generators, though. Marko -- https://mail.python.org/mailman/listinfo/python-list