using python ver 2.7.6
I wrote a simple riddle (from Harry Potter) in python and when the prompt come to the user in the command line, they have to enter "1" twice, "2" thrice, "3" four times (etc.) to get to the option they want to select. I know I'm missing something, but don't know what.
#potter_riddle
print " "
print "Pick Your Poison, Potter"
ascii_bottles = """
#########################################################
# _ #
# ( ) _ #
# _ ___ _ ___ / \ ( ) #
# / \ ( ) _ ( ) | | | | / \ #
# | | / \ / \ / \ | | | | | | #
# |___| (_____) (___) (___) |___| |___| |___| #
# 1 2 3 4 5 6 7 #
# #
#########################################################
"""
riddle = """
Danger lies before you, while safety lies behind,
Two of us will help you, whichever you would find,
One among us seven will let you move ahead,
Another will transport the drinker back instead,
Two among our number hold only nettle wine,
Three of us are killers, waiting hidden in line.
Choose, unless you wish to stay here for evermore,
To help you in your choice, we give you these clues four:
First, however slyly the poison tries to hide
You will always find some on nettle wine\'s left side;
Second, different are those who stand at either end,
But if you would move onwards, neither is your friend;
Third, as you see clearly, all are different size,
Neither dwarf nor giant holds death in their insides;
Fourth, the second left and the second on the right
Are twins once you taste them, though different at first sight.
"""
def answer():
if "1" in raw_input():
print "Hermione\'s advice was terrible! Now you\'re dead and Voldemort wins."
elif "2" in raw_input():
print "You\'re a little drunk. Try again."
elif "3" in raw_input():
print "Congratulations! Now go find Professor Quirrel."
elif "4" in raw_input():
print "Hermione\'s advice was terrible! Now you\'re dead and Voldemort wins."
elif "5" in raw_input():
print "Hermione\'s advice was terrible! Now you\'re dead and Voldemort wins."
elif "6" in raw_input():
print "You\'re a little drunk. Try again."
elif "7" in raw_input():
print "What the hell are you doing back in the Chess Room?"
else:
print "No, you cannot use a spell to get out of this. Try a number."
print ascii_bottles
print riddle
print "Which bottle shall you try?"
raw_input("> ")
answer()
answering 1 results in:
Which bottle shall you try?
> 1
1
Hermione's advice was terrible! Now you're dead and Voldemort wins.
answering 7 results in:
Which bottle shall you try?
> 7
7
7
7
7
7
7
7
What the hell are you doing back in the Chess Room?
Any advice would be much appreciated...