Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Looking for Python help! I know my code isn't right. Guessing Game Application Create the Guessing Game Application. The application should receive two integers from

Looking for Python help! I know my code isn't right.

Guessing Game Application

Create the Guessing Game Application. The application should receive two integers from the user, namely minimum and maximum and generate a random integer from minimum through maximum, inclusive. It then should give the user five chances to guess the integer. Each time the user makes a guess, the application should display one of two messages: Guess higher or Guess lower. If the user guesses the generated number the application should let her/him know and also display the number of chances that were required for the user to guess the number. If the user is not able to guess the number in five attempts the application should display Game over! and indicate the correct number. The program output should be formatted as shown in the Sample Run. Note: Python provides a function for generating a random integer within a given range. The function randint(minimum, maximum) which is defined in the random module, returns a random integer that is between minimum and maximum, including the bounds themselves. Before you can use the function, you need to import it as follows at the beginning of your code: from random import randint.

Enter a small positive number: 3

Enter a large positive number: 6

Enter your guess: 3

Guess higher

Enter your guess: 5

Guess higher

Enter your guess: 6

You've got it in 3 tries!

Enter a small positive number: 24

Enter a large positive number: 89

Enter your guess: 3

Guess higher

Enter your guess: 88

Guess lower

Enter your guess: 45

Guess higher

Enter your guess: 60

Guess higher

Enter your guess: 79

Game over! Number is 82

Enter a small positive number: 11

Enter a large positive number: 19

Enter your guess: 15

Guess higher

Enter your guess: 19

Guess lower

Enter your guess: 18

Guess lower

Enter your guess: 17

You've got it in 4 tries!

image text in transcribed

from random import randint 3 minimum-int(input("Enter a small positive number: ") 4 maximum-int (input("Enter a large positive number: ")) 6 number randint (minimum, maximum) 9 while guessesTaken number: if guessnumber: if guessesTaken! number: print("You've got it in", number, "tries!") 23print("Game over!","'Number is", number) 24 25 26 27 28 29 30 31 32 34 35 36 37

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago