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
What is the language of computers?
myrzilka [38]

<em>Answer:</em>

<em>Computers have language of their own. It is called Binary language. </em>

<em>It’s a very simple language with just 2 symbols – 0 and 1. A computer stores all information in the form of 0’s and 1’s.</em>

3 0
3 years ago
Cloud Kicks is undergoing a GDPR-focused implementation to ensure access to personal information data is limited to only users w
bija089 [108]

Answer:

Option A.

Explanation:

It is experiencing a GDPR-focused execution to assure only users who require full rights to a corporation's account have access to sensitive information and data. It has a design of their personal account.

So, the Consultant allows particular Account privileges to the sustainable and Sales Procedure teams through which they create Renewals and Sales Operation Account team membership roles and has sales team members allocated to the suitable customers.

5 0
3 years ago
Which is a good plan for backing up data?
Ymorist [56]
A, use external storage media such as CDs.
4 0
4 years ago
Which disk drive type contains a magnetic HDD with onboard flash memory serving as a non-volatile cache?
Shkiper50 [21]

Answer:

SSHD - Solid State Hybrid Drives

Explanation:

SSHD - Solid State Hybrid Drives -

Hard disk refers to a storage form of device , which uses uses the combination of the fast storage medium like the solid - state drive along with the very higher - capacity hard disk drive .

In the solid state hybrid drives , the combination of the onboard flash memory and the magnetic HDD , which is less expensive than the SSD.

Hence , from the given information of the question ,

The correct term is SSHD - Solid State Hybrid Drives  .

5 0
3 years ago
The declarations and statements that compose the method definition are called the __________.
Fiesta28 [93]

Answer:

a. method body.

Explanation:

A method contains the following components:

  • method name
  • method arguments
  • method return type
  • method implementation code

All of these together constitute the method body. The method body contains the declarations and statements constituting the method definition.

Apart from this, when the method is invoked at runtime, it needs to be called with method-name and the actual parameter list which gets substituted for the formal parameters in the method body.

8 0
3 years ago
Other questions:
  • Where can you access all the formatting options for worksheet cells?
    5·1 answer
  • In a cellular network, where does each wireless base station connect to?
    9·1 answer
  • Damian uses a modem to connect to a dial-up network. Which statements are true of a modem?
    11·2 answers
  • ____ is (are) the abuse of e-mail systems to send unsolicited e-mail to large numbers of people.
    14·1 answer
  • True of False - use T or F The Math class can be instantiated.
    15·1 answer
  • The effects of activating the complement system include all of the following except
    14·1 answer
  • Identify the following as True or False: (1) Naive Bayes is a linear classifier. (2) SVMs are only usable when the classes are l
    8·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • Line installers must complete a four-year university degree program in order to be hired.
    5·2 answers
  • We initialize the parameters to all zero values and run the linear perceptron algorithm through these points in a particular ord
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!