This is my function:
def mainMenu():
print " Do you want to send a message(send) or add a name to the database(add) or exit the program(exit)?"
answer = raw_input()
print answer
if answer is "send":
sendMessage()
elif answer is "add":
addName()
elif answer is "exit":
sys.exit()
else:
print "Sorry, '%s' is not a valid input. Please use one 'send', 'add', or 'exit'" %answer
No matter what I enter the result in the else
statement. The only thing I can really thing it is would be a problem with raw_input()
.
Here's a screenshot from the shell. The syntax highlighting is because I'm using sublimeREPL and it just does that, doesn't affect the code at all:
I've tested all the functions that are called and they work fine individually