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
Respecting yourself and others, educating yourself and connecting with others, and protecting yourself and others are all aspect
____ [38]

Answer: kind person

Explanation:

7 0
3 years ago
Read 2 more answers
What happens to a mechanical system when two opposing torques do not cancel out?
const2013 [10]
The system will move in the direction of the stronger torque
5 0
3 years ago
Looking at your Personal Fact Sheet, do you see any areas that may need improvement? In which areas do you have the most room fo
Andrej [43]
In the Church and in the classroom.
4 0
3 years ago
Read 2 more answers
How does math help you determine the amount of watts a turbine produces?
vlada-n [284]
It helps you determine the amount of watts a turbine produces because math is the only way to go
7 0
3 years ago
Which decimal value (base 10) is equal to the binary number 1012?
GaryK [48]

Answer:

The decimal value of 101₂² base 2 = 25 base 10

Explanation:

The number 101₂² in decimal value is found as follows;

101₂ × 101₂ = 101₂ + 0₂ + 10100₂

We note that in 101 + 10100 the resultant 2 in the hundred position will have to be converted to a zero while carrying over 1 to the thousand position to give;

101₂ + 0₂ + 10100₂ = 11001₂

Therefore;

101₂² =  11001₂

We now convert the result of the square of the base 2 number, 101², which is 11001₂ to base 10 as follows;

Therefore converting 11001₂ to base 10 gives;

11001₂= 1 × 2⁴ + 1 × 2³ + 0 × 2² + 0 × 2 ¹ + 1 × 2⁰

Which gives;

16 + 8 + 0 + 0 + 1 = 25₁₀.

7 0
3 years ago
Other questions:
  • Emma opened a new document a Microsoft word and typed her assignment. She is now planning to save the documents for the first ti
    11·1 answer
  • What is the name of the program file that you can enter in the Windows search or Run box to execute Event Viewer? What process i
    12·1 answer
  • George wants to edit the font of the title text in his presentation. Where can he find the option to edit it?
    6·2 answers
  • Having just one error on a cover letter may eliminate an applicant from being considered for employment?
    13·1 answer
  • Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T
    9·1 answer
  • Definition of digital
    9·2 answers
  • What is the correct order for writing the 3 dimensions for a 3D object? Here are the 3 dimensions:
    15·1 answer
  • Design a for loop that gets 6 integer numbers from a user, accumulates the total of them, then displays the accumulated total to
    9·1 answer
  • Modify your main.c file so that it allocates a two dimensional array of integers so that the array has 20 rows of 30 integers in
    14·1 answer
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!