Pick a number
You will write a program that will simulate the game where two players try to guess a number and the one who's closest wins.
1. Random secret number from 1 to 10 or any larger range if you want.
2. Two players will guess
3. Determine who was closest.
4. Display the results of the round in a neat and organized fashion.
5. Add some kind of style to your print outs so that your display is nice

Answers

Answer 1

In python 3+:

import random

secret_number = random.randint(1,10)

guess_one = int(input("Enter player one's guess: "))

guess_two = int(input("Enter player two's guess: "))

if abs(guess_one - secret_number) < abs(guess_two - secret_number):

   print(f"The secret number is {secret_number} and player 1 was closest")

elif abs(guess_one - secret_number) > abs(guess_two - secret_number):

   print(f"The secret number is {secret_number} and player 2 was closest")

else:

   print(f"The secret number is {secret_number} and it was a tie")

I hope this helps!


Related Questions

A programmer created a piece of software and wants to publish it using a Creative Commons license. Which of the following is a direct benefit of publishing the software with this type of license?

A

The programmer can ensure that the algorithms used in the software are free from bias.
B

The programmer can ensure that the source code for the software is backed up for archival purposes.

C

The programmer can include code that was written by other people in the software without needing to obtain permission.
D

The programmer can specify the ways that other people are legally allowed to use and distribute the software.

Answers

Answer:

The answer to this question is given below in the explanation section. However,  the correct answer is D.

Explanation:

This question is about publishing software under a creative commons license. The direct benefit of publishing the software under commons creative license is that the programmer can specify the ways that other people are legally allowed to use and distribute the software.

Because under this type of license, the publisher can publish their work under copyright law.  So they can control and specify the ways that how other people can use and distribute it legally.

While other options are not correct, because of its programmer responsibility that source code is free from error and bias, take backup for archival purposes. People can't include anything without obtaining permission etc.

The direct benefit of publishing the software with this type of license is option D.

The following information should be considered:

It is the programmer that represent the ways where the other people are permitted for using and allocating the software. Also under this license, the publisher could publish the work as per the copyright law.The source code should be free from error & bias, backup for archival purpose, without giving the permission represent the responsibility of the programmer.

Therefore we can conclude that the correct option is D.

Learn more: brainly.com/question/22701930

How do you change the behavior of the VR Robot?

Answers

Answer:

You can not do it

Explanation:

Answer:

To be able you have to change some of the robots codes, within the game.

Explanation:

You want to create a computer that processes data very fast. What do you need to achieve this goal?

a bigger cooling unit
large CPU caches
more ALUs
a bigger hard drive

Answers

Answer:

large cpu cache

Explanation:

trust me

Evan is borrowing a friend's laptop to check out some groovy music files. What can Evan look for to quickly identify
music files?
a messaging app
the hardware
the file extensions
the systems software

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct option for this question is the file extension. Because, by knowing the file extension, you can easily understand and know what the file is. If Evan checking out some groovy music files then he will definitely look at the file format to know that is it the music file or not.

Other options are not correct because:

messaging app function is to send the message, receive and store the message while hardware does not have any relation to identifying the music file and system software is an example of an operating system that also does not help the Evan for looking at music file on the laptop.

Answer:

It is C bruddahs

Explanation:

What is the definition of a noob? Please help. Define it in your own words but in an appropriate way, thank you very much!

Answers

Answer:

A person that is different from others by the way they look, act, ect.

what's my favorite color

black

red

purple

yellow

orange

Answers

Answer:

.

Explanation:

discuss two basic types of monitors CRT and LCD give me in short ​

Answers

Difference Between CRT Monitor and LCD Monitor is that CRT monitor is a desktop monitor that contains a cathode-ray tube. ... While An LCD monitor is a desktop monitorthat uses a liquid crystal display to produce images. These monitorsproduce sharp, flicker-free images

4. How could you apply some of the ideas, principles, or structures of coding to fields of study, industries, or tasks outside of creating computer programs? Propose at least one way to use "coding" or creating programs outside of computer science and explain how it uses coding-related concepts.

Answers

Answer:

a production plant

Explanation:

"Coding" brings with it a linear way of thinking and problem solving, where one step needs to be taken before moving on to the next step. This can be applied to a wide range of real-life scenarios and industries. For example, a production plant starts with an initial input, that input is taken and used in a set of instructions (method), those instructions take that input and create a new output. Once the new output is created it is then passed on to another set of instructions that takes that output as an input to create a new output. Just like a computer program, a power plant repeats this process in order to a fully working and realized product.

Cloud storage refers to the storage of data on ______.

Answers

Answer:

server

Explanation:

The storage of the data on the server of the web app is known as cloud storage.

The information regarding cloud storage is as follows:

It is the model of cloud computing in which the data is stored on the internet via the cloud computing provider that managed and operates the data storage.Also, it removes the purchasing & managing of the data storage infrastructure.

Therefore we can conclude that the storage of the data on the server of the web app is known as cloud storage.

Learn more about the data here: brainly.com/question/10980404

What is the value of numC when this program is executed?
numA = 4
numB = 10
if numA == 2:
numC = 10
elif numA > numB:
numC = 20
else:
numC = 30

Answers

numA = 4 and numB = 10

for the if statement to run, numA has to equal 2, which it doesn't.

for the elif statement to run, numA has to be greater than numB, which it isn't.

That leaves the else statement, therefore, numC = 30

Answer:

30

Explanation:

A database record can best be described as:
А
a collection of data about a limited topic, organized into rows and columns.
B
a collection of data that can be sorted and searched using search algorithms.
С
a category of information in a table.
D
a collection of information consisting of one or more related fields about a specific entity.

Answers

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct option to this question is D.

A database record can be best described as the collection of information consisting of one or more related fields about a specific entity. Because a database record represents a record about a specific entity for example a student record studying in a school. A student is a specific entity in the database and it has one or more related fields, for example, name, class, courses in which enrolled etc.

others options are not correct because:

A: a database record is a collection of data about a specific entity and it is not about a limited topic.

B: all database records can be sorted and searched using search algorithms but it is not necessarily because you can search data sometimes using quarries etc.

C: a database record is not a category of information in a table but it is a collection of one or more related field about a specific entity.

Answer:

c

Explanation:

what aspect should you consider before adding pictures to documents

Answers

Answer:

make sure you have the correct picture

Explanation:

it might vary to what document your working on

Which of the following statements are true regarding cognitive impairments? Select 3 options.
Speech input devices help those who are cognitively impaired understand the contents of the screen.
Delivering content in different ways, such as using video, animations, and text, helps promote cognitive accessibility.
To improve cognitive accessibility, the developer should focus on a clear and consistent design.
Even though there are different causes for cognitive impairment, many of the resulting functional issues are similar.
Cognitive issues are learning disabilities caused by genetic disorders.

Answers

Answer:

The correct options are;

Delivering content in different ways, such as using video, animations, and text, helps promote cognitive accessibility

To improve cognitive accessibility, the developer should focus on a clear and consistent design

Even though there are different causes for cognitive impairment, many of the resulting functional issues are similar

Explanation:

Cognitive impairment is the condition of a person having difficulty in concentrating, learning, recalling from memory, or making functional decisions. Depending on the severity, cognitive impairment may be classified as severe or mild

Symptoms includes, loss of memory, asking the same questions or telling the same story frequently, unable to recognize people they already know, or places they have already been to, having problems with vision and being unable to plan or see tasks through

Answer:

The correct options are;

Delivering content in different ways, such as using video, animations, and text, helps promote cognitive accessibility

To improve cognitive accessibility, the developer should focus on a clear and consistent design

Even though there are different causes for cognitive impairment, many of the resulting functional issues are similar

Explanation:

yall please help me in online school i only have 1 week to do it

its online by the way which is why it says computers and technology

Answers

Answer:

we cant see anything

Explanation:

Answer:

add meh back

Explanation:

pls

full detail about computer and its history


Answers

Answer:

The computer as we know it today had its beginning with a 19th century English mathematics professor name Charles Babbage. He designed the Analytical Engine and it was this design that the basic framework of the computers of today are based on. ... It was called the Atanasoff-Berry Computer (ABC).

Explanation:

Suppose you have a word processing application on your smartphone, your tablet, and your laptop. You are at home, and you need to write a paper for a class. A would be easiest to use for writing your paper.

Answers

Answer:

laptop

Explanation:

have a good day

Which characters in the function shown represent the arguments?
=MAX(B2:B6,C4,100)

A) =
B) MAX
C) (B2:B6,C4,100)
D) ( ,

Answers

Answer:

c

Explanation:

Answer:

C

Explanation:

what is amoeba cell do? max amount of points so pls answer​

Answers

Answer:

Ameoba is an organism which is unicellular and is a free-living cell. it is also a eukaryotic organism ( it has well-defined, membrane-bound cell organelles).

An amoeba cell has to carry out all the functions needed for its survival such as injection of food, digestion of food, excretion of waste, etc

An Amoeba cell is a unicellular organism. It is eukaryotic and has well-defined, membrane-bound cell organelles. Amoebas function as their own living body, so they create energy, move around, and throw out waste on their own.

what do we call the two parts of lift that goes down a mine

Answers

The sheave wheel is a pulley wheel that sits above the mine shaft. The hoist cable passes over the sheave wheel and then down the shaft of the mine.
(copied from google)

I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
select all that apply
Select the strategies below that are likely to increase audience attention.

Match special effects to content.
Use lots of different animation styles on each slide.
Use consistent transitions.
Use similar animation styles on each slide.
Avoid the use of animations.
Vary the use of transitions for each slide.

Answers

Answer:

All except the last one I hope

Explanation:

SOMEONE PLEASE HELP ME

Answers

Part 1:

x = first variable

y = second variable

print the variables to the console.

Part 2:

// Replace this with your name, today's date, and a short description.

def main():

   x = 'My favorite book is python for dummies.'

   y = 'I get to learn a lot about python.'

   print(x)

   print(y)

if __name__ == "__main__":

   main()

Part 3:

The purpose of my program was to express separate string variables and print them separately to the console. Also, I was able to demonstrate how functions work.

My program could be useful for storing values in variables for later. Although quite small, my program expresses how easy functions are to use.

I had trouble setting up my functions properly. To fix this problem, I looked back in our notes.

Next time, I will review our notes before starting the assessment. I will also remember how to properly use functions.  

Which media choices give you the most benefits? What are those benefits?

Answers

Answer:

Electronic media

Explanation:

1 make you popular

Which statement describes what happens when a user configures No Automatic Filtering in Junk Mail Options?

No messages will ever be blocked from the user’s mailbox.
Messages can still be blocked at the server level.
Messages cannot be blocked at the network firewall.
Most obvious spam messages will still reach the client computer.

Answers

Answer:

The last one

Explanation I think it is D because all of the other answers are saying what happen if you filter it.

The majority of obvious spam messages will continue to reach the client's computer. The correct answer is D.

What is junk mail?

Email spam, also known as junk email, spam mail, or plainly spam, is an unrequested email sent in mass. The name is derived from a Monty Programming languages sketch that includes the name of a canned pork product is mentioned. Spam is pervasive, unavoidable, and monotonous.

Back out of the Folder or any message folders users are viewing to access the Mailboxes view. The Junk folder is located beneath the Drafts and Sent directories in the Mailboxes view.

The Junk Email Filter settings can be changed in the Junk E-mail Dialogue box. Click Junk in the Deactivate group on the Home tab, and then click Garbage E-mail Options.

Most obvious spam messages will still reach the client's computer. Then the correct option is D.

More about the junk mail link is given below.

https://brainly.com/question/28354330

#SPJ6

what is a technology that exists inside another device called

Answers

Answer: embedded technology

Explanation: just took the test

Answer:

A

Explanation:

Embedded technology

X = 0
end = int(input("Pick a number: "))
for num in range(1, end, 2):
#missing line
print(x)
X 10.
This program should print the sum of all the ODD numbers between 1 and the user's number pick the "end" variable)
Write the missing line that will make that possible.
I think its print(1 + end) but If its wrong can I please have feedback cause I'm struggling with this 1.

Answers

The missing line would be x+= num

This means that every time a number is selected from the range it is added to the value of x.

Easy 10 point but can u plz help me

Answers

Answer:ITS TRUe

Explanation:there ya go :^

my school blocked a lot of gaming websites.. do you have any good games that are unblocked???

Answers

Answer:

Well, it depends some systems are more strict... Krunker wasn't blocked now it is for a different district. But, the Google Doodle games are never blocked. Try the Ghost Game 2016 from Google... Or the Snake Game, or Pac Man. There are a few others like Solitaire. Browse the Google Doodles.

Hope this helps!

Answer:

cliker heros and cool math games are some

Explanation:

The index finger on your right hand types the

Answers

Answer:

J

Explanation:

Samuel plans to use images of babies for a calendar. Which options should he choose?
A.
seek permission from the parents of the baby but do not mention the commercial use
B.
seek permission from no one, as it is the imageer’s duty to capture images
C.
seek permission from parents before using the baby’s image for commercial gains
D.
seek permission from the parents of the babies without telling them about where it will be used

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct option for this question is (C) -seek permission from parents before using the baby’s image for commercial gains

Because Samuel using images of babies for a calendar and use it for commercial purpose. So, she needs to seek permission from parents before using the baby's image for commercial gains. It is also required for her to tell babies' parents about the use of pictures commercially.  

Other options are not correct because legally and ethically she is bound to take permission from babies' parents before using it commercially.

Kerry is debugging a program. She identifies a line of code to begin execution and a line of code to end execution so that she is only running part of the computer program. Which is she using?
a.variable inspections
b.breakpoints
c.stepping functions
d.line-by-line search

Answers

Answer:

I think it's B on Edge, breakpoints

Explanation:

Answer:

B

Explanation:

Other Questions
Need help I am being timed 15x minus 8 is less than 32 Solve for g. C = d/g 51 divided by 3 is k. Solve for k. k = Whats the answer anybody??????? Which of these elements is most likely to be a colorless gas based on the type of element? Al, Pd, Ar, Cs HEY CAN ANYONE PLS ANSWER DIS MATH QUESTION!!! help!! im not good at simplifying.Instructions: Evaluate the following expression and enter the final simplified answer in the box provided. Use a forward slash (i.e. "/") to enter in fractions (e.g. -1/2 is the same as 12).(2)(5/6)= Which word in the sentence below is an adverb? Lia accidentally told her brother about his upcoming surprise party. A accidentally B told C about D surprise 2. How does the meaning of acuere add to the definition of acute PART B: Which quote from the text best supports the answer to Part A? Dark History of Rwandas Genocide Commonlit What is the measure of 1? Read the statement below then decide whether you agree or disagree with it. Beprepared to support your opinion with details from the story. Here's your discussionprompt:Obviously the characters in Shakespeare's play find MarkAntony's speech really convincing, but Shakespeare wrote theplay so that they would. But if you were to remove the easilyswayed audience and replace it with a more objective audience,Mark Antony's speech would still stand up as a convincing workof rhetoric. Giving this if someone can help me with this problem. After Becca's half-marathon, her pedometer showed 23,580 steps, while Alex recorded 2.42 x 10 steps after the same race. What is the combined amount of the steps? Solve: 3(g 2) = 8 Which ice cream rather have Chocolate- Mint or Cookie IN' Cream? Find a equation of the line for which (5,10) is a point on the line If Pinocchio says My Nose Will Grow Now, it would cause a paradox. Some dairy farmers want to increase the amount of milk produced by their cows. How can the farmers use selective breeding to increase milk production?A.By increasing the age of the cows that are bredB.By choosing cows that are high milk producersC.By limiting the number of offspring per cowD.By choosing cows that can produce milk after eating the most food What requirements must be met to obtain a marriage license?,Only one person applying for marriage must be present.Each person must be 21 or olderOcEach person must present proper identification, such as a driver's licenseOD. Each person may be married to someone else