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



The computer must make no more than the minimum number of guesses, and it must prevent the user from cheating by entering misleading hints.

Answers

Answer 1

Answer:

Follows are the code to this question

import random as R #import randaom package

import math as M #import randaom package

S= int(input("Input smaller number: "))#defining variable and input value

L= int(input("Input larger number: "))#defining variable and input value

C= 0#defining variable and assign value

while True:#define loop

   C+= 1#count value

   num= (S+L) // 2#calculate average

   print('%d %d' % (S,L))#print value

   print('number : %d' % num)#print average

   choice = input('Input =, <, or >: ')#input value in choice variable

   if choice == '=':#define if to check value

       print("Hooray, you get %d tries" % C)#print message

       break#use break  

   elif S==L:#defining and condition to check it is equal

       print("I'm out from the guesses, and you cheat")#print message

       break#use break

   elif choice == '<':#defining another condition to check

       L = num - 1#calculate larger value

   else:#else  

       S= num + 1# calculate smaller value

Output:

please find the attached file.

Explanation:

In the code first, we import the "math and random" package, then two-variable "S and L" is defined, in which it is used to input the value from the user-end, and variable "c" is defined to count the value.

In the next step, a while loop is defined, that uses the input value and print its average vale, and the choice variable to input the symbol value and use the conditional statement, which is defined as follows:

In if block, if the choice is equal it will print a message.In elif s is equal to l it will print message.In elif, the choice is "<" it will calculate the less value and print its value, otherwise, it will go in else, in this it calculates the value of "S".
Modify The Guessing-game Program So That The User Thinks Of A Number That The Computer Must Guess.The

Related Questions

What is Boolean algebra

Answers

Answer:

Boolean algebra is a division of mathematics that deals with operations on logical values and incorporates binary variables.

Explanation:

Which of the following statements are true?
A. There has been a decrease in the number of cyber attacks in the past decade.
B. Cybersecurity is the protection of computer systems, networks, and data from digital attacks.
C. Cyber attacks in the past few years have impacted individuals, governments, and organizations.

Answers

Answer:

I think the answer are two which are B and C

why is sequencing important in coding

Answers

It allows us to carry out task with multiple steps.

Answer:

To make sure you get the pattern correct.

Explanation:

Each code has a different detail that makes it do what it needs to do

Which camera does Angelina use?
Angelina uses a
and is a lot smaller than DSLRs.
camera, which is quite popular among photographers since it offers the same photo quality as a DSLR camera

Answers

Answer:

mirrorless cameras have lot more space due to not having mirrors. and they have the same or better quality than DSLR's.

Dave is a recruiter for a large video and animation firm. He is looking for an employee who is willing to give productive hours to activities related to the job. Which quality is he looking for? A. responsibility B. flexibility C. trust D. reliability E. integrity

Answers

Answer:

reliabitlity

Explanation:

Select all that apply.

Which font types are appropriate for use in text paragraphs?

serif
sans-serif
historical
script
novelty

Answers

Answer:

sans-serif, novelty, and script.

Explanation:

Which symbol is used to indicate that a formula may contain an error?
A. green triangle in upper-left corner of cell
B. an orange circle below the formula result
C. green triangle with question mark inside
D. a wavy purple arrow above the formula result

Answers

Answer:A.

Explanation:

Just had this question if is A

Answer:

its A they right

Explanation:

what are your favorite and least favorite things to do with microsoft powerpoint presentation​

Answers

Answer:

Animations , Motion Paths , Text and Image Emphasis are my favorite .

I like every about it

state two functions of windows environment​

Answers

Answer:

idonoheheheheheuhiiikv

what are the component s of computer ❓

Answers

Answer:

Depends which one are looking to build like gaming, work etc?

Explanation:

gaming there's the Motherboard, Cpu, Ram, Gpu, Power supply, ssd, memery and other stuff I can't remember

Answer:

Monitor, pc, box thing, keyboard, souls, and fbi codes so they can hack ur computer.

Explanation:

My life is a lie, reality is an illusion, have a fan-fudgeing-tastic day.

what is the definition of a virus?​

Answers

An infective agent that typically consists of a nucleus acid molecule in a protein coat

Answer:

Any of a large group of submicroscopic infectious agents that are usually regarded as nonliving extremely complex molecules, that typically contain a protein coat surrounding an RNA or DNA core of genetic material but no semipermeable membrane, that are capable of growth and multiplication only in living cells, and that cause various important diseases in humans, animals, and plants.

Explanation:

What sorts of items can be
configured when your
router has the ability to
add access rules

Answers

Answer:

A router connects multiple computers to the Internet through a single connection. The router manages the flow of data, delivering the right information to each computer on the network. Routers may also be used to connect multiple networks. A managed router is a router that is owned and managed by a third-party.

What are orphan records?

Answers

Answer:An orphaned record is a record whose foreign key value references a non-existent primary key value. Orphaned records are a concept within database relationships. If a record in a related table references a non-existent record in the primary table, it is said to be an orphaned record

Explanation:

hope this helps:)

What are the different kinds of program control structures?

Answers

Answer:

Flow of Control:

Flow of control through any given function is implemented with three basic types of control structures:

Sequential: default mode. Sequential execution of code statements (one line after another) -- like following a recipe

Selection: used for decisions, branching -- choosing between 2 or more alternative paths. In C++, these are the types of selection statements:

if

if/else

switch

Repetition: used for looping, i.e. repeating a piece of code multiple times in a row. In C++, there are three types of loops:

while

do/while

for

who is known as the first computer programmer​

Answers

Answer:

Ada Lovelace

Explanation:

English mathematician Ada Lovelace, the daughter of poet Lord Byron, has been called "the first computer programmer" for writing an algorithm for a computing machine in the mid-1800s.

Answer:

i think its ada lovelalce

A credit given to an author for his or her work is called a(an)

Answers

Citation.

Any other related questions you want answered?

Answer:

citation

Explanation:

Just did it in my online class, and my mom said so to

Summarize these two up-and-coming leadership positions in digital media: digital media supervisor and chief digital officer (CDO). What does each job entail? What is one way they are different? What is one way they are similar? Which one sounds more appealing to you, and why?

Answers

Answer:

The big differences in the CIO and the Chief Digital Officer is this responsibility for turning IT into a value creator, being a business to the extent of actually having a P&L, which is something that the CIO typically doesn’t have in most organizations.

And so we also see the CDO as something that is really leading digital business from the front in a way that most CIOs aren’t. Most CIOs are not trying to think of new markets, new channels, new business models that the organisation should be getting and making that a top priority. And that’s pretty much all the Chief Digital Officer thinks about is how to take existing assets, existing information, existing knowledge and making a business out of that creating products and services and entering new markets.

I think that the CIO, however, is used to operating much larger operations, so I think what remains to be seen we’re not seeing Chief Digital Officers have as much operational experience, or even necessarily seem to require it. Although I think the really successful digital businesses will be able to scale up their organizations really well, they’re going to have Chief Digital Officers that are good at that, we’re not seeing operational jobs as job number one, quite the same way as we’re seeing it in traditional CIOs.

In terms of really any other big differences, we see that Chief Digital Officers are very multidisciplinary, so they have a lot of different experiences, and there’re very comfortable in talking with marketing and sales in their language. They’re very good at talking to the product teams in their language and operations in their language, and executives and so on. And not to the same degree that we see the CIOs that don’t really talk the language of business, and they talk the language of the IT department but that tends to be it.

Explanation:

Digital Media Supervisor ( CIO )

Chief Digital Officer ( CDO )

A program is written to prompt the user and accept input until a negative value is entered. What is the common term for this special value?

Answers

I’m pretty sure it’s while loop

Select the appropriate things to try if you are unable to connect to the Internet.

A) Check the correct IP address.

B) Switch to a different router.

C) Turn the power off and on repeatedly.

D) Run net start.

F) Switch cable types.

G) Check the browser configuration.

H) Check

Answers

Answer:

the correct answer is C and G.

Explanation:

Usually when a home router isnt working properly the first thing you should do is restart the router. Then, check your browser config to see if theres any issues.

ASAP ε=ε=ᕕ(°□°)ᕗ
Sorry if you can't see it but please help me if you can!

Answers

Answer:
I would say C

Why did LISD had to block the game “among us”?

Answers

Lewisville Independent School District blocked the following program: Among Us because the game was a distraction to online education. Normally, school districts disable/block games that students play to make sure they are not just playing games and that they are paying attention during class.
To cut off anything I that might not be school related like for example distractions

How does multimedia content enhance a user’s Web browsing experience

Answers

Explanation:

The inclusion of multimedia content such as videos, photographs and flash will help you increase your website's graphic feature, but it will also provide your visitors more value from certain pages and provide them a more positive experience, maintaining them mostly on site for something like a prolonged period of time.

Select the correct answer.
What is the postcondition of an expression or variable?
a. the condition of the expression before you execute a control structure
B. the value of the expression when you increment a variable
c. the value of the expression when you decrement a variable
d. the condition of the expression once you exit a control structure
e. the condition of the expression while running a control structure

Answers

A. the condition of the expression before you execute a control structure

Answer:

D.

Explanation:

You're Welcome

Discribe a place that you have dremed about that does not exit in a real life

Answers

Candy land ??? A cotton candy land with trees filled with sweet fruits and candy ?
Game world where you play games all day in that world and it looks like a swamp

Constructive criticism
Brainstorming possible solutions means one person generates all the ideas.

True
False
Question 2(Multiple Choice Worth 3 points)
(03.04 MC)

Your friend has asked you to provide one tip for accepting constructive criticism. Which of the following is the best technique?

Become defensive about the criticism
Reflect upon the criticism
Resist seeking solutions to the behavior that prompted the criticism
Tune out the critic's criticism
Question 3 (True/False Worth 3 points)
(03.04 LC)

Constructive criticism deals with a person, not his or her behavior.

True
False
Question 4 (True/False Worth 3 points)
(03.04 LC)

Project managers have the overall responsibility for planning, executing, and completing a project.

True
False
Question 5(Multiple Choice Worth 3 points)
(03.04 MC)

Read the following scenario:

A project will require more people than originally estimated.

Identify the possible risks to the project.

Ideas and creativity
Money and resources
Policies and procedures
Time and work ethic is intended as a possible solution. True False

Answers

Answer:

1. False

2. Reflect upon the criticism

3. True

4. False

5. True?

Answer:

1. True

2.Reflect upon the criticism

3.True

4.False

5.Time and work ethic is intended as the possible solution

uses computer resources from multiple locations to solve a common problem ​

Answers

Distributed memory systems
I think is the answer

Answer:grid computing

Explanation:

Help!! Its not working at all and idk what to do!

Answers

Answer:

1st. Let the teacher know

2nd. Check your internet

3rd. Make sure all other tabs are closed

Explanation:

This always helps me I hope it helps you too !! :3

you want some points? whoever answers first gets 48 points. no cap. better be quick.
what's 2+2=?

Answers

Answer:

4

Explanation:

Answer:

4444444444444444444444444

Where can I watch yarichin b club lol

Answers

i know an app but hwne i try to write it it says inapooripirate...

hhbbbdjwkwbfiefbwjfbejdb

Which technology is most often used to update parts of a web page without reloading the whole page

Answers

i believe it would be AJAX :’)

Answer:

It's AJAX I think

Explanation:

Other Questions
Which best describes the background of John Adams?A. He was a merchant who smuggled goods to avoid customs.B. He was a plantation owner and former military leader.C. He was a lawyer who questioned Britains tax policies.D. He was a blacksmith who delivered fiery speeches against taxation. Which of the following correctly describesa solid?a. The particles do not move at all.b. The particles are closely locked in pigsition and can vibrate in place.c. The particles are free to d. move about independently. colliding frequentlyThe particles are closely packed but have enough energy to slide past eachother. Matching Match the term in the Word Bank to the best definition below. A. aberration B. desultory C. disarray D. equilibrium E. incoherent F. indiscriminate 6. pandemonium H. rambunctious I. rampant . prerogative 1 chaos or confusion 2. unselective, random, or haphazard 3. aimless or rondom 4. confused or illogical 5. a state of disorganization or confusion 6. a deviation from the norm 7. widespread or out of control 8. a state of balonce 9. wild and unruly 10. an exclusive right or privilege Look at the picture please HELP PLZZZZZZZZ!!!!!!!!!!!!!!!! what order the events as they take place in The Grapes of Wrath Franceska charges eight dollars an hour to babysit children five years of age and younger and six dollars an hour to babysit children over five years of age this week Francisco spent 10 hours babysitting a two-year-old and five hours babysitting an eight-year-old and how much money did Francisco make from babysitting this week 1. $65 to $75 2. 350 yards to 420 yardshelp pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls help pls v How can you avoid bursitis while doing physical activities? Which of these was an effect of the industrial revolution at the end of the nineteenth century?women's suffragerural population growthan economic boom in the northeastlaws guaranteeing rights for labor unions ASAP!!!!how do i write the intercept form equationy=a(x-p)(x-q)when i know a=-16p=-0.12q=1.12 What executive department is headed by a superintendent elected by the voters?O department of educationdepartment of public safetyO department of public transportationO department of national resources A U.S. Navy ship that exploded, or blew up, and sank in the harbor at Havana, Cuba, in 1898. Although it is still unknown what caused the explosion, this event was part of the reason for the Spanish-American War. ps ill give whoever answers this correctly brainliest Topic: The U.S. House of Representatives is debating discretionary spending for a new Congressional budget. Some representatives want to allocate more funds for defense spending. Others want to create a federal grant to states for a social service program that would benefit families in low-income communities. Assignment: Imagine you are a Congressional aide. Help your representative prepare for a debate on the budget by completing the notes below. Choose one side of the issue: provide more money for defense or funds for a federal grant. Complete research on this topic, using a variety of online sources. Then fill out the worksheet. Claim: ______________________________________________________________ ____________________________________________________________________ Supporting Reason: __________________________________________________ ____________________________________________________________________ Supporting Evidence: _________________________________________________ ____________________________________________________________________ Supporting Evidence: _________________________________________________ ____________________________________________________________________ Counterclaim: _______________________________________________________ ____________________________________________________________________ Rebuttal: ____________________________________________________________ ____________________________________________________________________ the plymouth colony is eventually absorbed by which colony ? What is the average rate of change from x = 4 to x = 1 PLEASE HELP MEA fire damaged several of the apartments next to the one where the fire started.Damage may have been reduced by controlling the transfer of thermal energywith the use of better -A. conductionB. convectionC. insulationD. radiation Why is convection is a method of heat transfer in liquid and in gas but not in solids? why does your eye vein pop my did I was sleeping and then when I woke up there was blood well it was popgive me a real answer or I will report u what property is y(x+5)