error help import random

Dylan Riley dylan.riley at hotmail.com
Fri Nov 20 12:22:10 EST 2015


This is my fortune cookie program i wrote in python.
the problem is it will not run past the first line of input.
could someone please identify the error and explain to me why.
here is the code:

#the program silulates a fortune cookie
#the program should display one of five unique fortunes, at randon, each time its run

import random

print("  \\ \\ \\ \\ DYLANS FORTUNE COOKIE \\ \\ \\ ")
print("\n\n\tGood things come to those who wait")
input("\nPress enter to see your fortune")

fortune = random.randrange(6) + 1
print(fortune)
if fortune == 1:
    print("happy")
elif fortune == 2:
    print("horny")
elif fortune == 3:
    print("messy")
elif fortune == 4:
    print("sad")
elif fortune == 5:
    print("lool")

print("hope ypu enjoyed your fortune being told")
input("\nPress enter to exit")


many thanks in advance



More information about the Python-list mailing list