Even without knowing the operator precedence, this will be evaluated either
as:
(name == "John Cleese") or "Michael Palin")
or:
name == ("John Cleese" or "Michael Palin").
Case 1: (name == "John Cleese") evaluates to either True or False. False
or "Michael Palin" evaluates to ( believe it or not) " Michael Palin"!
Which, as far as if is concerned, is True. True or "Michael Palin"
evaluates to True.
Case 2: "John Cleese" or "Michael Palin" evaluates to False; name== False
evaluates to False.
One way to get the results you want:
if name in ("John Cleese" or "Michael Palin"):