# There are 5 errors in the program below! # Find them and fix them! from random import * def intro(): print("You are standing on the corner of 23rd and Cherry on a beautiful spring day.") print("The birds are chirping and the sky is very blue.") def ezell(): outcome = randint(1,3) if(outcome < 3): print("You enjoy a nice meal of chicken.") else if: print("You have died of food poisoning!!") def library() print("You read a book and gain knowledge!") answer = raw_input("Would you like to go to Ezell's now? ") if("yes"): ezell() def ezell_or_library(): choice = raw_input("Would you like to 1) go to Ezell's or 2) go to the library? ") if(choice == 1): ezell() else: library play_again = "yes" while(play_again == "yes"): intro() ezell_or_library() print("You have completed the game!") print("Would you like to play again? ") ''' Expanded example to inspire you! Use some of these advanced ideas from random import * from time import * # to use sleep points = 0 # a global variable shared between functions def intro(): print("You are standing on the corner of 23rd and Cherry on a beautiful spring day.") print("The birds are chirping and the sky is very blue.\n") # \n adds a line break def ezell(): global points # so I can update the global points outcome = randint(1,3) if(outcome < 3): print("You enjoy a nice meal of chicken.") points = points + randint(1, 4) else: print("You have died of food poisoning!!") def library(): global points points = points + 1 print("You read a book and gain knowledge!") answer = raw_input("Would you like to go to Ezell's now? ") if(answer == "yes"): ezell() def ezell_or_library(): sleep(1) # pause for a second choice = int(raw_input("Would you like to 1) go to Ezell's or 2) go to the library? ")) if(choice == 1): ezell() else: library() play_again = "yes" while(play_again == "yes"): points = 0 # reset points at the beginning of a round intro() ezell_or_library() print("You have completed the game with " + str(points) + " points.") play_again = raw_input("Would you like to play again? ") '''