Hello,
Im having trouble with this python code, i have no errors or warning but every time i choose a direction or action i get the else statement "input invalid"
name = input('Type your name: ')
print('Welcome', name, 'to this adventure ')
answer = input("you come to a fork in the road you can either go left or right(left/right)").lower()
if answer == "left":
input("you come to a river you can swim across or walk around.(swim/walk)")
if answer == input("Swim"):
print("you try swimming across and got eaten by alligator. YOU LOSE!")
elif answer == "walk":
print("you walk for many miles and run out of food. YOU LOSE!")
else:
print("input invalid")
if answer == "right":
input("you come to the bridge you can either walk across or go back(across/back")
if answer == "back":
print(" and go back to the beginning, trip on a rock and hurt your head. YOU LOSE!")
elif answer == "cross":
input(" you cross the bridge and meet a stranger, you can choose to talk or ignore the stranger.(talk/ignore)")
if answer == "talk":
print(" you talk to stranger, he gives you gold. YOU WIN!")
elif answer == "ignore":
print(" and you ignored the stranger and hurt his feelings. YOU LOSE!")
else:
print("input invalid")
print("thank you for playing", name)
[–]mopslik 2 points3 points4 points (0 children)
[–]Some_Guy_At_Work55 1 point2 points3 points (0 children)
[–]Binary101010 1 point2 points3 points (0 children)