subject

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!

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. after the loop terminates, it prints out, on a line by itself and separated by spaces, the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by at least one space. declare any variables that are needed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system.in); is given.
Answers: 3
question
Computers and Technology, 22.06.2019 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
You know the right answer?
Must be python format Create a program which will choose a random number between 1 and 1000.
...
Questions
question
Mathematics, 03.12.2019 16:31
question
History, 03.12.2019 16:31
question
Mathematics, 03.12.2019 16:31