Code runs. But for some reason when I am prompted to enter Sam, I get back “Your name isn’t Sam.”
name = ["Sam"]
print ("What is your name?")
name_choice = input("Type Here: ")
if name == "Sam":
print ("Your name is Sam")
else:
print ("Your name isn't Sam")
I am working in Python 3.2. Any help would be appreciated. Thanks!
I think you should be using
name_choicehere instead ofnameWhat is the
namevariable meant for anyway?A good tip when something like this happens is to print the things you are comparing right before the
ifeg
This would have made it apparent that you are comparing a list to a string