I am a beginner in Python. As a step to try and learn it I am now creating a story type game.
So I want to check if the user has entered a valid input.
print("You see two roads, one to the left and one to the right...\n")
time.sleep(1)
answer = input("Do you want to go left or right?[Valid answer is yes/no\n").lower
if answer == "yes" :
print("You start to walk left")
else:
print("You end your journey here, thanks for playing")
quit()
Ok, so basically the only check I get here is if the user types yes or no, but what if the user types something else? I would then love to have an option that prints out "Please type yes or no" and then sends the user the same question again??
Sorry if I did not manage to answer this in a good way, english is not my native language.