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
Write a recursive method to form the sum of two positive integers a and b. Test your program by calling it from a main program t
77julia77 [94]

Answer:

see the code snippet below writing in Kotlin Language

Explanation:

fun main(args: Array<String>) {

   sumOfNumbers()

}

fun sumOfNumbers(): Int{

   var firstNum:Int

   var secondNum:Int

   println("Enter the value of first +ve Number")

   firstNum= Integer.valueOf(readLine())

   println("Enter the value of second +ve Number")

   secondNum= Integer.valueOf(readLine())

   var sum:Int= firstNum+secondNum

  println("The sum of $firstNum and $secondNum is $sum")

   return sum

}

5 0
3 years ago
When you build a computer from parts, you usually start by deciding on which processor and motherboard you will use?
loris [4]
The thing to look for is compatible RAM, Processor and motherboard. Then I would choose my graphics card, hard drive, etc.
3 0
3 years ago
En la historia del Computador porque se caracteriza la primera generación? *
Nadusha1986 [10]

D. Por el uso de tubos de vacio.

8 0
3 years ago
Where is the fill handle located
Ronch [10]
The fill handle will appear as a small square in the bottom-right corner of the selected cell(s). Click, hold, and drag the fill handle until all of the cells you want to fill are selected. Release the mouse to fill the selected cells
4 0
2 years ago
4. How do artistic designing and engineering designing differ? How do they overlap?
zhannawk [14.2K]

Answer: design is art, art is design.

Any good artist is designing their work. Any good designer has an art to their work. The artist "designs" the composition of any piece they create, be it a painting, sculpture, furniture, etc. There is design even in a child's drawing.

Explanation:

6 0
3 years ago
Other questions:
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    9·2 answers
  • Nadia would like to find text in her current document that differentiates CompanyABC from companyabc. Which option should she us
    8·2 answers
  • Which windows tool is used to determine if a dynamic disk is corrupted?
    6·1 answer
  • What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
    13·1 answer
  • . Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
    13·1 answer
  • When was internet started in which year​
    13·2 answers
  • What is the difference between word processing software and email?
    12·2 answers
  • Are you absent minded because you are thinking of an online activity?​
    12·1 answer
  • David plays racing games on his way to work. He uses the analog stick to navigate his vehicle through other artificial intellige
    7·2 answers
  • You conduct an experiment to find the probability of a flipped coin landing on
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!