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
Which magazine introduced the first microcomputer kit for the mits altair in its january 1975 issue?
Tcecarenko [31]

Answer:

Popular Electronics  is the correct answer.

Explanation:

It is the first magazine that released in the year 1975, Jan. The following magazine is about the initial microcomputer kit which for the Mits Altair.

So, that's why the following answer is not false because it is the first magazine that released the article about the following microcomputer kit that is update on the cover of the magazine.

6 0
3 years ago
Midday is a good time to take a portrait outside.<br> true or false?
Over [174]

Answer:

B: False

Explanation:

edg2020

4 0
2 years ago
Does a 21.6v battery work with a 24 volt controller
Mila [183]
Yes but you will need more than one battery
3 0
3 years ago
Match the following
kakasveta [241]

Answer:

Eraser tool -removes the unwanted part of the drawing.

Row -horizontal space running from left to right.

Text -Primary component of a multimedia.

Drawing Area -Working are of ms point program.

I hope this helps!! Correct me plz if I'm wrong. If I'm right, could you mark me as brainliest?

8 0
2 years ago
A car manufacturer uses'simulation software during the design process for a new car. Which of the
exis [7]

D I,II and III is the answer i think

5 0
2 years ago
Other questions:
  • âwhat two log files are used by older versions of unix and newer version of linux to store log information
    10·2 answers
  • What are three new things in Microsoft Word 2016?
    5·1 answer
  • 5. How should you use LinkedIn Answers as a professional?
    8·1 answer
  • Why do contour lines never cross?
    5·1 answer
  • Write structured pseudocode to show the following: print “Reorder” when the quantity is less than 20; otherwise print “OK”.
    15·1 answer
  • Jin needs to add a row into his spreadsheet, but he does not want to remove any existing data. Which combination of options shou
    6·2 answers
  • A computer virus is a program that can copy itself and infect a computer without the permission of the owner. How do you think a
    9·1 answer
  • What read a page on website​
    15·1 answer
  • Compare mini and mainframe computer in terms of speed,memory and storage​
    15·1 answer
  • security investigators discovered that after attackers exploited a database server, they identified the password for the sa acco
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!