On Fri, 14 Jun 2013 16:07:56 +0300, Nick the Gr33k wrote: > Thanks for explaining this but i cannot follow its logic at all. My mind > is stuck trying to interpret it as an English sentence: > > if ('Parker' and 'May' and '2001') > > if ('Parker' or 'May' or '2001') > > i just don't get it and i feel silly about it.
Python is not English. You just have to accept that, no matter how much you wish it worked like English, it does not. Think of it like this: "If today is Tuesday AND I finish work early, then I can go to the movies." Unless *both* conditions are true, I cannot go to the movies. "If today is Tuesday AND I finish work early AND I have more than $16 spare cash to pay for a ticket, then I can go to the movies." All three conditions must be true, or I cannot go to the movies. If today is Monday, I don't need to check whether I finish work early, or whether I have spare cash. It is enough to know that today is not Tuesday, so I'm not going to the movies. Python works the same way: today_is_tuesday = True finish_work_early = True spare_cash = 11 if today_is_tuesday and finish_work_early and spare_cash > 16: print("Going to the movies") else: print("No movies today.") -- Steven -- http://mail.python.org/mailman/listinfo/python-list