This Python program is a simple game where the user tries to guess a randomly-generated number within a specified range. The user can select the range of possible numbers using a slider, and the program will generate a random number within that range. The user can then input their guesses, and the program will give feedback on whether the guess was too high, too low, or correct. The user has a limited number of guesses, and the program will end when the user either runs out of guesses or correctly guesses the number.
The program uses the streamlit and random libraries to create the game. The random library is used to generate the random number, and the streamlit library is used to create the user interface and handle user input. The user's input is stored in a number_input widget, and the program checks whether the input matches the randomly-generated number. If the input is too high or too low, the program displays a message indicating this, and if the input is correct, the program displays a success message and ends the game.
Click Here to see the Program in action
- Set the max range between 666 and 700 and enter 666 as a guess to display the answers. This lasts until the page is reloaded.