It's because of your conditions. When you say...
if letter == "A" or "a"
...you are actually saying...
if it's true that 'letter' equals 'A', or is true that 'a'
... and "a"
, as a non-empty string, evaluates always to true. You are not asking anything from letter
in the right-hand side of the or
. Do this:
if letter == "A" or letter == "a"
Or, since we're in python:
if letter in ["A", "a"]
Cheers!