def deeper(): options = ["very dark", "Sinister", "pitch dark", "scary"] print ("** **") print ("Hello " + playername + " you are in a " + random.choice(options) + " forest \n\ you cannot see anything, you hear a noise in the dark do you want to lash out or run") choice = input("Type Back or i or Lash") if choice == "Back" : deep() elif choice == "i" : PrintInventory() deeper() elif choice == "Lash" : if "knife" in inventory : #if the knife is held the more chance of winning newRandom = random.randrange(1,150) else: newRandom = random.randrange(1,100) print(newRandom) if newRandom < 50 : #less than 50 you lose and die print("********") print("You lash out at the noise in the dark - you contact \n\ something soft and with fur, however you feel the clench of teeth on your neck \n\ A basilisk attacks you with a scaberous arm and sharp teeth - you are dead") DeleteInventory() print("**************") time.sleep(5) meadow() elif newRandom > 50 and newRandom < 75 : #50 to 75 a chance to escape print(" ") choiceQ = input("Do you want to answer a question to try to escape Y or N ?") if choiceQ == "Y" : choiceQ = input("What is the Capital of France") if choiceQ =="Paris" : print("You are correct - you escaped") print("You run back the way you came, away from the basilisk") deep() else: print("You were killed trying to escape - a basilisk attacked you \n\ with a scaberous arm and sharp teeth - it drained your blood") DeleteInventory() meadow() else : #over 75 and you win killing the basilisk print("You find the target and the basilisk falls at your feet quivering \n\ you turn and run back into the forest") deep() else: print("Wrong choice only Back` or i or Lash") deeper()