super new to python, and just trying out a few if else statements on my own. I wanted to try and make an if/else which reacted to user inputs, but all im getting back is the else statement at the bottom, and not one of the other statements. i’ve been looking around and cant find an answer as to what im messing up. thank you for any assistance you can give!
below is the code I wrote out:
user_answer = input("are you a male, or a female?:")
male = ["male", "Male", "MALE"]
female = ["female", "Female", "FEMALE"]
if user_answer == male:
print("oh well thats awesome to hear! hello sir!")
elif user_answer == female:
print("oh sick, nice to meet you miss")
else:
print("im sorry, but that is not a valid entry")`
what I was expecting to happen was it to give me the first if statement if I typed in either male, Male, or MALE into the input, and the same for the elif but for female. however all it is giving me is the else statement
Robert Gibbons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.