import random lives = 3 while lives > 0: print("You creep along the tunnel...") trap = random.choice([True, False]) # Randomize trap if trap: print("You fall into a trap and die!") lives -= 1 else: print("You find an opening and you continue your journey.") print("Lives left:", lives) print("You have no lives left. GAME OVER!")