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
kaheart [24]
3 years ago
5

Write a program that plays a reverse guessing game with the user. The user thinks of a number between 1 and 10, and the computer

repeatedly tries to guess it by guessing random numbers. It’s fine for the computer to guess the same random number more than once. At the end of the game, the program reports how many guesses it made.
Computers and Technology
1 answer:
nika2105 [10]3 years ago
4 0

Answer:

  1. import random  
  2. target = 7  
  3. count = 0
  4. for i in range(100):
  5.    guess = random.randint(1,10)  
  6.    
  7.    if(guess == target):
  8.        count += 1
  9. print("Total of correct guess: " + str(count))

Explanation:

The solution is written in Python 3.

Firstly, import the random module since we are going to simulate the random guess by computer. Next, we presume user set a target number 7 (Line 3). Create a counter variable to track the number of correct guess (Line 4).

Presume the computer will attempt one hundred times of guessing and we use randint to repeatedly generate a random integer between 1 - 10 as guess number (Line 6). If the guess number is equal to the target, increment count by one (Line 8-9).

Display the total number of right guess to terminal (Line 11).  

You might be interested in
Along a road lies a odd number of stones placed at intervals of 10 metres. These stones have to be assembled around the middle s
nikitadnepr [17]

Answer:

hope this helped you,(ㆁωㆁ)

3 0
4 years ago
What type of Microsoft Server serves as an email server?Your sister asks you if it is possible to get an office productivity sui
lapo4ka [179]

Microsoft Exchange server serves as email server. There are other servers as well which are being used by Exchange server is most popular one.  Yes, they provide free trial versions to their users so that they can use the technology. For this purpose you should visit their website and download it for free trail version.

5 0
3 years ago
Read 2 more answers
Describe at least five ways in which information technology can help students studying subjects other than computing
bija089 [108]

Answer:

yan lang po sana makatulong

5 0
3 years ago
Plzz helps me with hw
IceJOKER [234]

Answer:

1. not statistical

2. statistical

3. statistical

4. not statistical

5. statistical

6. not statistical

7. statistical

Explanation:

The statistical can compare more then 1 thing to make it reasonable.

4 0
4 years ago
Input and output devices provide means of communication between computers and outer world<br>​
abruzzese [7]

Answer:

See explanation

Explanation:

This question seem incomplete as what's required was not stated.

To answer this question, I'll assume it's a fill-in-the-gap question

The definition given above describes computer peripherals.

Peripherals is one of the links between a computer user and the computer itself.

Through peripherals such as keyboards, mouse, light pen , one can send input into the computer.

In the same vein, one can get outputs through peripherals such as the computer monitor, speakers, printers, etc.

3 0
3 years ago
Other questions:
  • If you delete a view, account administrators can recover the view using the "trash can" function within how many days?
    7·2 answers
  • How can you tell if a hacker has administrative access?
    15·2 answers
  • When would you use conditional formatting on a cell?
    9·1 answer
  • What can you say about the following Java class definition?
    10·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • How can the Internet help our country to be a leader in technology?
    6·1 answer
  • A search engine is the same as a browser.<br> \
    11·1 answer
  • If a folder exists on an NTFS partition, which permission is needed by a user who needs to set security permissions on the folde
    11·1 answer
  • How many micro processors will a small computer have? A. none B. two C. one D. three
    8·2 answers
  • 15. How many PC’s can be connected to a UPS?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!