Today this Monday I am working on a project on YouTube choose your own Adventure
answer = input(
"You are on a dirt road, it has come to an end and you can go left or right. Which way wolud you like to go? "). lower()
if answer == "left":
answer = input("You come to a river, you can walk around it or swim accross? Type walk to walk around and swim to swim accross: ")
if answer == "swim":
print("You swam acrross and were eaten by an alligator.")
elif answer == "walk":
print("You walked for many miles, ran out of water and you lost the game.")
else:
print('Not a valid option. you lose.')
elif answer == "right":
answer = input("You come to a bridge, it looks wobbly, do you want to cross it or head back. ")
else:
print('Not a valid option. You lose.')
if answer == "back":
print("You walked for many miles, ran out of water and you lost the game.")
elif answer == "cross":
answer = input("You cross the bridge and meet a stranger. Do you talk to them(yes/no)? ")
if answer == "yes":
print("You talk to the stranger and they give you gold. You WIN!")
elif answer == "no":
print("You ignore the starnger and they are offended and you lose. ")
else:
print('Not a valid option. you lose.')
else:
print('Not a valid option. you lose.')
print("Thank you for trying", name)
- This code asks the user a question on a path that the user can want to go on their is a Left or Right path the user can choose.
if answer == "left":
answer = input("You come to a river, you can walk around it or swim accross? Type walk to walk around and swim to swim accross: ")
if answer == "swim":
print("You swam acrross and were eaten by an alligator.")
elif answer == "walk":
print("You walked for many miles, ran out of water and you lost the game.")
else:
print('Not a valid option. you lose.')
- This part of the code is Left path that the user can choose .
elif answer == "right":
answer = input("You come to a bridge, it looks wobbly, do you want to cross it or head back. ")
else:
print('Not a valid option. You lose.')
if answer == "back":
print("You walked for many miles, ran out of water and you lost the game.")
elif answer == "cross":
answer = input("You cross the bridge and meet a stranger. Do you talk to them(yes/no)? ")
if answer == "yes":
print("You talk to the stranger and they give you gold. You WIN!")
elif answer == "no":
print("You ignore the starnger and they are offended and you lose. ")
else:
print('Not a valid option. you lose.')
else:
print('Not a valid option. you lose.')
- This part of the code is The right path that the user can choose.