1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anastassius [24]
3 years ago
6

Modify the guessing-game program so that the user thinks of a number that the computer must guess.

Computers and Technology
1 answer:
olga_2 [115]3 years ago
5 0

Answer:

import random

import math

smaller = int(input("Enter the smaller number: "))

larger = int(input("Enter the larger number: "))

count = 0

print()

while True:

   count += 1

   myNumber = (smaller + larger)

   print('%d %d' % (smaller, larger))

   print('Your number is %d' % myNumber)

   choice = input('Enter =, <, or >: ')

   if choice == '=':

       print("Hooray, I've got it in %d tries" % count)

       break

   elif smaller == larger:

       print("I'm out of guesses, and you cheated")

       break

   elif choice == '<':

       larger = myNumber - 1

   else:

       smaller = myNumber + 1

Explanation:

  • Inside an infinite while loop, add the smaller and larger number and assign that value to myNumber variable.
  • Check the choice and then print the relevant display message.
You might be interested in
With which network connection type does the vm obtain ip addressing information from its host?
Alex73 [517]
<span>With which network connection type does the VM obtain ip addressing information from its host? Answer: Bridged Mode</span>
5 0
3 years ago
Do Violent Video Games Make People More violent in Real Life ?
vova2212 [387]
To be honest, NO. Its just a videogame but i see what you are saying...
4 0
4 years ago
What would you do if you experienced academic frustrations in school? Check all that apply.
kipiarov [429]
I think it is all of them :))
6 0
3 years ago
Read 2 more answers
What is the minimum number of data points you should usually have to look for signs of improvement on a run chart?
nexus9112 [7]

Answer:

There Should be at least 10 Points

Explanation:

An execution graph becomes more powerful as you add more data points because there will be more opportunities to identify patterns. If you are looking for signs of improvement, you usually need at least 10 data points.

Performance charts (frequently acknowledged as line graphs outside the excellence management field) display the performance of the process over time

6 0
3 years ago
Write a program that reads in an array of type int . you may assume that there are fewer than 50 entries in the array. your prog
Alla [95]
This may be a difficult thing to do so for anyone to ACTUALLY answer this you migghttt want to up the amount of points you get for answering maybe, 20-40 points.
7 0
3 years ago
Other questions:
  • The program prompts the user to interactively enter eight batting averages, which the program stores in an array. The program sh
    9·1 answer
  • In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
    6·1 answer
  • Create a new file that contains a summary of the total consumption for three sectors: "Residential," "Commercial," and "Industri
    10·1 answer
  • Name some technologies that engineers create
    13·1 answer
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • Meaning of ‘integrity of data’
    14·2 answers
  • TRUE AND FALSE
    10·1 answer
  • Anyone know what the very first question that was sent on brainly is?
    15·2 answers
  • How do I get the pictures from my old Samsung phone to put on my iPhone? The Samsung is turned off. Is there a way to transfer i
    8·1 answer
  • processing C. have only one function, e.g. control traffic lights in a town, games machines 7 To create a formula, you first: A.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!