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
Can someone help me explain Nvm scheduling in operating systems?
Marat540 [252]

Low-power and short-latency memory access is critical to the performance of chip multiprocessor (CMP) system devices, especially to bridge the performance gap between memory and CPU

3 0
3 years ago
When hundreds, thousands, or even hundreds of thousands of zombie computers are gathered into a logical computer network under t
Ainat [17]
Virus such as a Trojan or Worm, and can cause network crashes.
4 0
3 years ago
Read 2 more answers
Which are examples of embedded systems? Choose two answers.
SVEN [57.7K]

Answer:

An operating system inside a virtual machine

Smart TVs

Explanation:

We can explain an embedded systems like a system within other system, in this case we have two examples, the smart TV have an operative system in some cases an Android system, and this system is within the television system, the virtual machine is the same concept, we can have an Android system running in a windows system.

7 0
3 years ago
Josh needs to write a research report for his Civics class. Which file type will allow him to save his file?
jolli1 [7]
Answer is Doc type format
4 0
3 years ago
Read 2 more answers
In the ( ) Model, each in a network can act as a server for all the other computers sharing files and acsess to devices
Pavel [41]

Answer:

C peer to peer

Explanation:

  • A peer to peer is a computer network in a distributed architecture that performs various tasks and workload amount themselves. Peers are both suppliers and consumers of resources. Peers do similar things while sharing resources, which enables them to engages in greater tasks.
3 0
3 years ago
Other questions:
  • Our company is only interested in purchasing a software upgrade if it leads to faster connectivity and data sharing. The old sof
    7·1 answer
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • Will upvote!
    12·1 answer
  • 1. The number of major solutions for preventing workplace hazards is
    14·1 answer
  • Discuss the importance of employee security awareness training. What innovative ways should company’s implement security trainin
    14·1 answer
  • What should a consultant recommend to meet this requirement?Universal containers assign its contact center agents to certain int
    12·1 answer
  • Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series
    9·1 answer
  • Company Wizzy is having trouble with network security. Issues with authentication, viruses, malware/spyware, and other network i
    12·1 answer
  • 5. Which one of these can connect directly to the internet?
    9·2 answers
  • What are the features of boot sector virus​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!