I am trying to define a simple function which checks if what the user placed into the arguments equal the letter B (No reason. Just made it B.) This is my code:
def letter_check_B(letter):
letter = str(letter)
if letter == 'B':
print("You entered B")
else:
print("You did not enter B")
However, when using the above code, by typing in:
letter_check_B(B)
I get an error stating:
NameError: name 'B' is not defined
How would I go about to fix this without changing how the overall code works. I want to be able to make this code work by placing the letter into the argument (if that is possible).