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
How do ice and water on the ground affect incoming solar radiation? They filter 22 percent of solar radiation that reaches the s
olganol [36]

Answer: 4 percent

Explanation:

8 0
3 years ago
Read 2 more answers
While researching ideas for cutting energy costs is his company. Hector watches an online video in which a business expert says,
Nataliya [291]
B. Put it in quotes if it is directly quoted as is and cite the source. You should likely also list the source in the works cited but not the phrase itself.
6 0
3 years ago
Read 2 more answers
Differentiate among a color display, gray scale display, and a black-and-white display​
kotykmax [81]

<u>Answer:</u>

<em>Black and white</em>:

It has only two values namely black or white. The white colour in the image will be represented as “white” and other colour part will be displayed as black.

<em>Grey-scale: </em>

Again the white part does not have a change, the black and other coloured items will be displayed in grey.

<em>Coloured image: </em>

It would display the actual colour of the image. The number of colours and shades depends on the original image from where actually it has been shooted and it also depends on the quality of the camera.

4 0
3 years ago
What would the range(3, 9) function generate?
gregori [183]

Answer:

A, 3,6,9

is the answer

Explanation:

bc it count by

3 0
3 years ago
To copy the formatting of selected text to another place in the document use _____.
ANEK [815]
To copy the formatting of selected text to another place in the document use the paintbrush AKA. Format painter
7 0
3 years ago
Other questions:
  • 14. Which commercial RDBMS product was the first to hit the market and is the biggest?
    15·1 answer
  • In internet terminology, what is the term, .com, called?
    12·2 answers
  • Which method allows a computer to react accordingly when it requests data from a server and the server takes too long to respond
    5·1 answer
  • A lottery ticket contains five unique numbers. A set of unique numbers does not contain repeated elements. The winning combinati
    10·1 answer
  • A USB device used to transfer photos from the memory card to a hard drive is called a _____.
    5·2 answers
  • Networking and telecommunications technologies, along with computer hardware, software, datamanagement technology, and the peopl
    11·1 answer
  • Joe runs a handyman service. He enjoys writing and keeping up on the latest trends. He wants to share this information with his
    14·1 answer
  • Write a python program that requests a positive integer from the user, determines if it is a composite, a prime or neither prime
    8·1 answer
  • Write a C# program named DoubleDecimalTest thatdeclares and displays two variables - a double and a decimal.Experiment by assign
    9·1 answer
  • what must you consider when determining the efficiency of an algorithm? select two choices. group of answer choices the amount o
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!