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
LenKa [72]
3 years ago
11

# Initialize variables

Computers and Technology
1 answer:
Ne4ueva [31]3 years ago
5 0

numGuesses = 0

userGuess = -1

secretNum = 5

name = input("Hello! What is your name?")

while userGuess != secretNum:

   userGuess = int(input("Guess a number between 1 and 20: "))

   numGuesses = numGuesses + 1

   if (userGuess < secretNum):

       print("You guessed " + str(userGuess) + ". Too low.")

   if (userGuess > secretNum):

       print("You guessed " + str(userGuess) + ". Too high.")

   if(userGuess == secretNum):

       print("You guessed " + str(secretNum)+ ". Corret! "+"It took you " + str(numGuesses)+ " guesses.")

You might be interested in
Which of the following should you always wear to avoid being thrown from a vehicle and then crushed if it tips over?
Ber [7]
I belive the answer would b "D" hope this helps
6 0
3 years ago
Read 2 more answers
How do you get free Wifi on your phone without paying
Monica [59]
The library offers free wifi. I don’t think you can get free Wifi without paying(unless you go somewhere that offers free wifi). I don’t recommend you hacking into people’s Wifi(you can go to jail).
6 0
3 years ago
Laxmi was not confident that she could learn to program a computer. When she found out that two girls with similar GPA’s in her
Lapatulllka [165]

Answer:

She got motivated to work harder. She did not want to be less smarter that the other girls.

Explanation:

She was shy in the beginning, but then once she heard out the  other girls could do it very well. She then got motivated.

7 0
3 years ago
_ effects determine how slide elements disappear
kupik [55]
<span>Exit effects determine how slide elements disappear. </span>
6 0
4 years ago
How to play Drinkopoly game?
professor190 [17]
Answer:
Never heard of that lol
3 0
3 years ago
Other questions:
  • Q3** Write a query to create a new price list for books written by the same author. Allow the user to enter only the first 4 let
    15·1 answer
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • What can you do to make sure you have a healthy credit report
    13·2 answers
  • Cyberlaw consists of: a. only state statutes. b. only federal statutes. c. traditional legal principles that have changed becaus
    6·1 answer
  • Almost immediately after a server migration project, employees are complaining that they can't reach the Internet. You sit down
    8·1 answer
  • Dan works for an automobile company. He has designed a new model of a car based on an older version. Which technology can he use
    6·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • Random Access Memory is tempory computer memory that stores works in progress
    7·1 answer
  • If you give an actual answer I'll give brainliest​
    13·2 answers
  • If we ignore the audio data in a video file, a video file is just a collection of many individual frames (i.e., images). What is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!