Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed Can someone please fix this??

–1 vote
asked Mar 2, 2021 by Christopher Bartholf (290 points)
closed Mar 2, 2021 by Admin
import time
print("Welcome to the jungle, a place where magical creatures abound.") time.sleep(2)
print("These creatures are not friendly, and to make it out of the jungle aliv time.sleep(2)
print("Good luck!") time.sleep(2)
health = 20print("You first encounter a giant three-horned beetle! It is black, slimy, an time.sleep(2)
print("The beetle starts charging toward you!")
choice = input("Would you like to fight or run?")
if choice == "fight":
    weapon = input("Your options are to set a trap, use your bare hands, or use a stick.")
    if weapon == "set a trap":
        print("You have captured the beetle!")
        health = health + 50
    if weapon == "use bare hands":
        print("You have lost to the beetle. Game over.")
        exit()
    if weapon == "use a stick":
        print("You have killed the beetle!")
        health = health + 50
else:
    print("You have outrun the beetle and are safe!")
    health = health + 30
print("You have",health,"health points.") time.sleep(2)
print("Uh-oh! A huge dinosaur with purple wings is flying right towards you! It has sharp, pointy teeth and looks hungry!")
time.sleep(2)
print("You can redeem your health points for a sword or a pair of wings.")
time.sleep(2)
option = input("Would you like a sword or wings?")
if option == "wings":
    health = health – 20
    print("You can fly!")
    time.sleep(1)
    print("You now have", health, "health points.")
    time.sleep(2)
    print("The dinosaur is flying after you!")
    time.sleep(2)
    print("The dinosaur has overtaken you. Game over.")
    exit()
if option == "sword":
    health = health - 20
    print("You now have a sword!")
    time.sleep(1)
    print("You now have", health, "health points.")
    time.sleep(2)
    print("Get ready for the fight!")
    time.sleep(2)
    strikes = random.randint(3, 6)
    for i in range(strikes):
        print("The dinosaur strikes you!")
        health = health - 10
        time.sleep(1)
        print("You now have", health, "health points.")
        time.sleep(2)
        if health = 0:
            print("You have been mortally wounded. Game over.")
            exit()
        print("You strike the dinosaur!")
        time.sleep(2)
    print("Finally, the fight is over, and you have survived the attack!")
    time.sleep(2)
closed as a duplicate of: Can someone please fix this??
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...