Question: The program generates a random number between 1 and 1 0 0 0 0 0 0 0 . Using a guessing function, the program then

The program generates a random number between 1 and 10000000. Using a guessing function, the program then attempts to guess this number by generating random guesses. If the random guess is higher than the lottery number, the program tells the guessing function that the guess is bigger otherwise the guess is smaller or that the guess is correct. The program should contain the following functions:
guess_lottery(): function to guess the lottery value.
main(): to begin the program execution and end the code. Python Library Functions allowed: len(), print(), list(), str(), input(), int(), type(), chr(), ord(), range(), random.randint() and float().
Any other library functions not allowed.
Desirable:
1. Error checking and well commented programs.
2. Input validation is preferable.
3. Try/catch are not allowed.
4. Built-in functions like isalpha(), isdigit(), isalnum() etc., are not allowed.
5. Math module is not allowed. need code in python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!