So I am trying to create a program that takes in a customer choice of food. I want the user to be able to input their choice in capitals so I can then convert it to lowercase and then compare it using an if statement
Name = str(input("What is your Name?"))
Name = ''.join(Name.split())
foodChoice = str(input("Would you like a Burger or Salad?"))
foodChoice = foodChoice.lower()
if foodChoice == 'burger':
print("true")
else:
print("false")
Let's assume the customer inputs "BurgER"
The problem I'm experience is that even after I convert "BurgER" into lowercase after the input is declared, the if statement still regards it as false...take a look at my sample output below
What is your name? Jason
Would you like a Burger or Salad? Burger
false
Process finished with exit code 0
EDIT: The problem seemed to be because I added a space before burger out of habit :/, on that note, is there any way to account for this?