Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

Draw all resonance for nitrile imine CENN

Answered: 1 week ago

Question

Discuss the states of accounting

Answered: 1 week ago

Question

=+free to pirate employees from competitors?

Answered: 1 week ago