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
What are 3 customizations that can be done using the header/footer section in the customize reports tray?.
Vesnalui [34]

The 3 customizations that can be done using the header/footer section in the customize reports tray are:

  • One  can customize the data, and also sum up that is add or delete columns, and also add or delete information on the header/footer.

<h3>What is the customizations  about?</h3>

In the case above, a person can also be able to personalize the font and style of the given report that they have.

Note that a lot of  columns and filters differ for all kinds of  report/group of reports and as such, The 3 customizations that can be done using the header/footer section in the customize reports tray are:

  • One  can customize the data, and also sum up that is add or delete columns, and also add or delete information on the header/footer,

Learn more about customizations from

brainly.com/question/3520848

#SPJ1

4 0
2 years ago
Help plz!! I will mark brainliest
Semenov [28]

Answer:i found this

Explanation:

6 0
3 years ago
Read 2 more answers
To create a chart you need to select at least ___ in a range of data
Blababa [14]

Answer:

2 by 2 squares of data

Explanation:

If you have less than that it is not a chart.

5 0
3 years ago
How do I cancel my membership or Subscription on here
timurjin [86]

Answer:

You don't

Explanation:

7 0
3 years ago
A search engine displays a list of webpage names that contain the search text. what is the term for that list?
Minchanka [31]
<span>A search engine displays a list of webpage names that contain the search text. The term for that list is hit.
Basically, what this term refers to is the number of visits, or a number of downloads that happened on that particular webpage. It is a good tool to measure web traffic, or how much that page is visited.
</span>
6 0
3 years ago
Other questions:
  • A customer has contacted you to help him alleviate the large amount of time and effort that goes into adding and removing users
    12·1 answer
  • Hybrid protocol is similar to which other protocol?
    10·1 answer
  • 60 POINTS!
    13·1 answer
  • Differentiate between the broadcasting and telecommunication
    5·1 answer
  • Why might a variable used for output have to be of a different type then a variable used for input? ​
    12·1 answer
  • The Binder Prime Company wants to recognize the employee who sold the most of its products during a specified period. Write a qu
    12·1 answer
  • In PowerPoint, a picture might be a photograph, a shape you draw, a piece of clip art, or an illustration created using a graphi
    7·2 answers
  • Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolut
    15·1 answer
  • The scope of a temporary table is limited to what?
    10·1 answer
  • scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!