New to Python (and any programming at all) as of this week.
Trying to create something simple, but failing.
def question(): answer = str(raw_input("Would you like to know it's location? Y/N:")).upper if answer != "Y" and answer != "N": print "Invalid: You can only respond with Y or N" elif answer == "Y":
The elif statements following the initial if shown here are never evaluated, regardless of the input given.
i.e. if the input is y or n or Y or N, I want it to then consider the elif, but it always prints the message beneath the if statement.
This is the console output:
Would you like to know it's location? Y/N: Y
Invalid: You can only respond with Y or N
Can someone please give me a tip / advice on what I am doing wrong?
Thanks in advance.