Question
import random import time def displayIntro(): print('''You are in a land full of dragons. In front of you, you see two caves. In one cave,
import random import time def displayIntro(): print('''You are in a land full of dragons. In front of you, you see two caves. In one cave, the dragon is friendly and will share his treasure with you. The other dragon is greedy and hungry, and will eat you on sight.''') print() def chooseCave(): #IT appears that you ended up putting a unexpented indent on line 20 cave = '' #There was another unexpcted error on next line while cave != '1' and cave != '2': print('Which cave will you go into? (1 or 2)') cave = input() # There is a indent that is unexpected return caves def checkCave(chosenCave): print('You approach the cave...') #sleep for 2 seconds time.sleep(2) print('It is dark and spooky...') #sleep for 2 seconds time.sleep(3) print('A large dragon jumps out in front of you! He opens his jaws and...') print() #sleep for 2 seconds time.sleep(2) friendlyCave = random.randint(1, 2) if chosenCave == str(friendlyCave): print('Gives you his treasure!') else: #There are missing parentinesses in the call to print. Did you mean to print Also there is an indent that is unexpected print() 'Gobbles you down in one bite!' displayIntro() caveNumber = choosecave() checkCave(caveNumber) print("Thanks for planing")
I am having trouble fixing this in python I need help
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started