Use a while() loop that checks for the answer. Also, you should print what options are available as an answer instead of making the enterer guess. This is not intended as a complete answer.
while intro not in ["yes", "no"]:
intro = input("Want to play a game of number guess? ('yes' or 'no'")
available_guesses = [str(x) for x in range(1, 11)]
while intro == 'yes':
guess = "0"
while guess not in available guesses:
guess = input("\nOkay. Just guess the number I am thinking of from 1 to 10. ")
while intro not in ["yes", "no"]:
intro = input("Want to play a game of number guess? ('yes' or 'no'")
(sorry i didn't know how to explain it well)
That is why you can't code it. You have to first explain it in words, in detail, in order to explain it in code?
woooee
Posting Maven
2,705 posts since Dec 2006
Reputation Points: 827
Solved Threads: 779
Skill Endorsements: 9
Question Answered as of 2 Years Ago by
woooee