Question: For Python 3 Write a Python program that generates a random number from 1 to 10, including 1 and 10. Prompt two users to guess
For Python 3
Write a Python program that generates a random number from 1 to 10, including 1 and 10. Prompt two users to guess the number. Identify which guess is closest. If both guesses are equally close, print something stating there are no winners. You will likely have to use abs() which calculates the absolute value of the argument. abs(5) = 5, abs(-5) = 5, abs(0) = 0. You can assume ideal input users will not type the same guess.
HINT: Print the random number before prompting the users so the program is easier to debug.
Sample Run:
User 1, enter a number between 1 and 10: 8
User 2, enter a number between 1 and 10: 9
User 1 guessed 8 which is closer to 3 than 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
