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
lina2011 [118]
3 years ago
10

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumbe

r and allow the user to continually input numbers until they correctly guess what secretNumber is. Complete the method guessMyNumber that uses a while loop to ask the user for their guess and compares it againist secretNumber. For example, if secretNumber was 6, an example run of the program may look like this:_______.
Computers and Technology
1 answer:
Tom [10]3 years ago
5 0

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

You might be interested in
High capacity circuits are limited by the least capable network link, which is typically the user connection. As such, it is imp
Mariana [72]
The answer is “true”
4 0
3 years ago
Why can videos be streamed from the cloud to a computer with no loss in
mezya [45]
I think the answer is B
3 0
2 years ago
Read 2 more answers
What is the best anime that you like the most (give me 3 plz)
Dmitry [639]

Answer:

The rising of shied hero, last hope, and dragon pilot.

4 0
2 years ago
Read 2 more answers
If your computer determines the destination address of a network packet is to a remote network.
Arisa [49]

The data link layer software would replace the MAC address of the next hop or gateway when the destination address of a network packet is to a remote network.

<h3>What is a data link layer?</h3>

The data link layer is the second layer of the OSI model and it can be defined as an interface between the network and physical layer. Also, it comprises two (2) main sublayers and these include the following:

  • Logical link control (LLC) layer.
  • Media access control (MAC) layer.

In Computer networking, the data link layer software would replace the MAC address of the next hop or gateway when the destination address of a network packet is to a remote network.

Read more on data link layer here: brainly.com/question/13131540

#SPJ1

5 0
2 years ago
What is considered any computer system that isn't a general-purpose pc or server?
Kay [80]

Embedded system is considered any computer system that isn't a general-purpose pc or server.

<h3>What is an embedded system?</h3>

An embedded system is a combination of computer hardware and software designed for a specific function. Embedded systems may also function within a larger system. The systems can be programmable or have a fixed functionality.

<h3>What is embedded system and its types?</h3>

Embedded systems comprise hardware and software that work together to perform specific tasks. They rely on microprocessors, microcontrollers, memory, input/output communication interfaces, and a power supply to function

To learn more about embedded system, refer

brainly.com/question/13014225

#SPJ4

3 0
1 year ago
Other questions:
  • Page orientation can be either landscape or _____.
    13·1 answer
  • True or false: a cover letter accompanies a resume to showcase a job-seeker’s personal life
    6·2 answers
  • When was unicode invented?
    13·1 answer
  • The faster the clock speed, the more of these the processor can execute per second. what are they?
    15·2 answers
  • Una bombilla de 40 w de potencia está encendida durante 10 horas. Calcular la energía que ha consumido en julios y en kw·h.
    12·1 answer
  • Greg wants to check the amount of requests his website receives. What test can he use?
    6·1 answer
  • Does nature behave the exact same way as fractals?
    15·1 answer
  • Who Has any idea How to code?
    7·2 answers
  • Use the drop-down menus to explain how to locate the Consolidate dialog box.
    6·1 answer
  • What Microsoft feature enables you to represent text as colorful visuals
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!