This commit is contained in:
Tanguy Deleplanque
2025-06-10 15:15:59 +02:00
parent 27a71817bc
commit df845a95cf
2 changed files with 18 additions and 0 deletions

18
003/task.py Normal file
View File

@ -0,0 +1,18 @@
print("Welcome to Treasure Island.\nYour mission is to find the treasure.")
if input("left or right?\n").lower() != "left":
exit("Fall into a hole.\nGame over")
if input("swim or wait?\n").lower() != "wait":
exit("Attacked by trout.\nGame Over.")
last_choice = input("there are three doors: red, blue, yellow. which do you pick\n").lower()
if last_choice == "red":
exit("Burned by fire.\nGame Over.")
elif last_choice == "yellow":
exit("You win!")
elif last_choice == "blue":
exit("Eaten by beasts.\nGame Over.")
else:
exit("Game over.")