
this code uses the random function which takes a random number and makes it the number you have to guess.
and the else at the bottom of the picture makes sure that its a number and if it is not then it will print invalid guess and will tell you to make another guess. i also have it print the amount of guesses it took you to find the answer.