Build a guessing game where the computer has to guess the correct number which was entered by the user between 1 and 100. You will work with Python’s random module (Links to an external site.), build functions, work with while loops and conditionals, and get user input. You will also output the number of times computer could not guess the number correctly
We won’t do your assignment for you, but we can help when you run into problems.
Start by writing a function that asks the player for a number, and retrieves that number from them.
(Hint: the input(prompt) function will help.
Then write a function that will try to guess a number. (Hint: look at the random module.)
Then you will need to repeatedly call that guessing function, until the guess is correct.
Hint: you need a loop, Python has two sorts of loops: for loops, for when you know in advance how many times the loop will run; and while loops, when you don’t. Which one do you think you need?