I'm trying to make a simple quiz in python to check if the user is able to determine who my friends are. It is still not complete but basically I want the program to give a certain response if the user enters a certain input that matches my list. For example, the first question is "Who is my BEST friend?". If the user enters "Mariah", I want the program to tell them they are correct and then move on to the next question. My problem is when I enter that, the response should check for the match and it doesn't match up even for the correct input. It completely ignores if my if statement for getting the "you're correct!" statement and jumps directly to the else statement: "sorry you're incorrect". How do i fix this?
list = ["Mariah", "Julian", "Gabbi"]
variable = input("do you know my friends? yes or no? ")
if variable.lower() == "yes":
print("oh really... ")
variable2 = input("what is my best friend's name? ")
if variable2.lower() == list[0]:
print("you are correct, but she's not my only friend")
else:
print("sorry you're WRONG!")
elif variable.lower() == "no":
print("i thought so...")
else:
print("that answer didn't make sense")
You are converting the input to lower case but not the list value
try