I am having trouble with the following logic:
Lets say I have a list:
L = ['a', 'b', 'c']
Both items are in the list...
if ('a' or 'b') in L:
print "It's there!"
else:
print 'No sorry'
prints It's there!
Only the first item is in the list...
if ('a' or 'd') in L:
prints It's there!
Neither item in the list...
if ('e' or 'd') in L:
prints No sorry
Here's the confusing one. Only the second item in the list...
if ('e' or 'a') in L:
prints No sorry
I do not understand why this is not registering as a true statement. How does this generalize to an or statement with n conditionals?