Dec-14-2017, 07:24 PM
(Dec-14-2017, 07:01 PM)sean5 Wrote: if userAnswer == "Y" or "y":
That's not going to do what you expect. Here's a few examples of
or
, ending up with a few ways you should do this instead:>>> value = "n" >>> if value == "Y" or "y": ... print("match!") ... match! >>> value == "Y" or "y" 'y' >>> if 'y': ... print("match!") ... match! >>> if value.lower() == "y": ... print("match!") ... >>> if value in ["Y", "y"]: ... print("match!") ...