How To Build Number Guessing Game With Python.
NUMBER GUESSING GAME
Number guessing game is a starting of a AI. In this game computer guesses a number between (1, 20) then we have to predict the correct number within a range of (6).
In line 15, we have range of 6 ,This means that we have to guess the correct number within 6 chances (not more than 6 chances). We can increase or decrease the chances any number of time.
In line 11, random.randint(1, 20) is basically gives the range of number a computer can choose. We can change the number(1, 20) to (1, 356) or (3, 999) to increase the interest in the game.
If you run the above program , you will see the following output.
Whenever i play this game most of the time i lose in this game.
If you are winning you seems to be champion.
Comments
Post a Comment