Computers and Technology

Must be python format Create a program which will choose a random number between 1 and 1000.
Ask the user to guess at the number, and give the user feedback if their guess is too high or too low.
Also, keep track of the number of guesses that the user makes.
"Redirect" the user if they enter a number outside of the range of 1 to 1000, and the error should not count as one of their guesses.
When the user finally guesses the answer, congratulate them and inform them how many guesses it took them to arrive at the correct number. (and the program should end)
Much of this will be done using the WHILE command, and perhaps an IF statement.

(sample output of the program is below)

Guess a number between 1 and 1000? 500
Your guess is too low! Try a higher number.

Guess a number between 1 and 1000? 2000

Whoops, guess a number between 1 and 1000? 750
Your guess is too high! Try a lower number.

Guess a number between 1 and 1000? 625
Your guess is too high! Try a lower number.

Guess a number between 1 and 1000? 560
Your guess is too high! Try a lower number.

Guess a number between 1 and 1000? 530
Your guess is too high! Try a lower number.

Guess a number between 1 and 1000? 515
Your guess is too low! Try a higher number.

Guess a number between 1 and 1000? 520

Your guess is too high! Try a lower number.

Guess a number between 1 and 1000? 517

Your guess is too low! Try a higher number.

Guess a number between 1 and 1000? 518

You got it! The number is 518 and you got it in 9 guesses!

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, paigesyring
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
image
Computers and Technology, 25.06.2019 04:20, claraesson5581
Austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names. an unknown individual took control of austin's servers and transferred the domain names to another registrant without austin's permission. the new registrant began using the domain names to host malicious content—including hate letters to customers and fraudulent contact information—and to post customers' credit-card numbers and other private information, thereby tarnishing austin's goodwill. austin filed a suit in a federal district court against the new registrant under the anticybersquatting consumer protection act. is austin entitled to a transfer of the domain names? austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names
Answers: 3
image
Computers and Technology, 25.06.2019 07:00, joey4843
What statement would cause polarization
Answers: 1
Do you know the correct answer?
Must be python format Create a program which will choose a random number between 1 and 1000.
...

Questions in other subjects:

Konu
Mathematics, 08.04.2021 03:40
Konu
Mathematics, 08.04.2021 03:40