Question: Task 1 Input from the user Open the Python 3.10 Integrated Development Learning Environment (IDLE) and create a new project named, GuessNumber Have the computer

Task 1 Input from the user Open the Python 3.10 Integrated Development Learning Environment (IDLE) and create a new project named, GuessNumber Have the computer select a random number with the following commands: from random import randint print() num = randint(1,9) user_guess = 0 Create a loop that will check to see if the user_guess is the same as the random number while user_guess != num: Inside the loop get a guess from the user and check to see if the guess is lower than the number user_guess = int(input(Enter a guess from 1 to 9: )) if user_guess < num: print(Guess is low) elif user_guess > num: print(Guess is high) else: print(You guessed it!) Keep running the program until you get one Guess is high, Guess is low, and you guessed it response. Deliverables for Task 1 Screenshot of your GuessNumber program Screenshot of the results of running your program. Task 2 Adding a counter Now you will add a counter to keep track of the number of guesses. Before your looping statement add a counter with guess = 0

Add the counter statement inside the loop (before the if statements): guess += 1 Change the winning statement to: print(fYou guessed it! You won in {guess} guesses!) Deliverables for Task 2 Screenshot of your GuessNumber program Screenshot of the results of running your program.

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!