0

I am trying to have a program react dependent on what the user types but i do not want it to be case sensitive e.g.

MenuOption = input("Login or Register or Press 'Q' to quit")
while MenuOption != "login" and MenuOption != "register" and MenuOption!= "q":
    print("Please enter one of the two options")
    MenuOption = input("Login or Register")

the program only allows you access if you type in lowecase but I do not want the case of the letters to affect it at all so you could type in "lOgIN" and it would still read that as login.

Thanks guys!

1 Answers1

1

Use the .lower() method, e.g. MenuOption.lower(). This will convert the input string to all lowercase letters.

schaefferda
  • 338
  • 1
  • 4
  • 14