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
Someone, please answer this.
Sav [38]

Answer: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too. statement - Code to be repeated in the loop.

Explanation:

7 0
3 years ago
Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
Alex

Answer:

The answer to this question is the option "B".  

Explanation:

In this question, the answer is option B which is 1,000 because the kernel is a central part of an operating system. kernel manages the computer and the hardware operations. most especially memory and CPU time. It also sheared a memory variable is allocated to thread blocks. That's why the answer to this question is 1,000.

7 0
3 years ago
In addition to being fun, another reason that people have been creating games ever since they settled into communities is:
aleksklad [387]

Answer:

I am pretty sure it's D. to teach strategy and critical thinking.

6 0
2 years ago
Read 2 more answers
Select the correct answer.
Vitek1552 [10]

Answer:

I think it's C. but not a 100%

6 0
3 years ago
Read 2 more answers
What kind of operating system is Windows? Command-line Browser based Graphical user interface Linux-based
snow_tiger [21]
Graphical user interface
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following filenames is acceptable on both Windows and Mac<br> operating systems?
    9·1 answer
  • What's a good show to watch on Netflix?
    7·1 answer
  • Troubleshooting comes before diagnosing. Answer: false
    7·1 answer
  • Which code fragment constructs an arrray list named players that is initialized to contain the strings "player 1" and "player 2"
    15·1 answer
  • Fill in the blank
    11·1 answer
  • There are a few simple rules that you can follow to store and manage files and folders in your computer. What is the most import
    9·2 answers
  • Select the two statements below that are true. Press on the info button for
    13·1 answer
  • Operating systems provide a measure of security by allowing users to access to those resources they've been cleared to use as we
    8·1 answer
  • I love my baby boy and can someone help me with this
    6·1 answer
  • A pseudo code that asks the user for their forename and their surname , and then outputs both, separated by a space to the user​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!