subject
Computers and Technology, 11.10.2021 14:00 dubouuu

PLEASE HELP BRAINLIEST EASY FOR PEOPLE WHO CODE WILL GIVE BRAINLIEST PLEASE I AM STUCK NEED HELP Part 1: Review the Code

Review the code and locate the comments with missing lines (# Fill in missing code).

On the surface this program seems simple. Allow the player to keep guessing until he/she finds the secret number. But stop and think for a moment. You need a loop to keep running until the player gets the right answer.

Some things to think about as you write your loop:

• The loop will only run if the comparison is true.

(e. g., 1 < 0 would not run as it is false but 5 != 10 would run as it is true)

• What variables will you need to compare?

• What comparison operator will you need to use?

# Heading (name, date, and short description) feel free to use multiple lines

def main():

# Initialize variables

numGuesses = 0

userGuess = -1

secretNum = 5

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

# Fill in the missing LOOP here.

# This loop will need run until the player has guessed the secret number.

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.")

# Fill in missing PRINT statement here.

# Print a single message telling the player:

# That he/she guessed the secret number

# What the secret number was

# How many guesses it took

main()

Output

Your guessed 10. Too high.

Your guessed 1. Too low.

Your guessed 3. Too low.

Good job, Jax! You guessed my number (5) in 3 tries!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
You know the right answer?
PLEASE HELP BRAINLIEST EASY FOR PEOPLE WHO CODE WILL GIVE BRAINLIEST PLEASE I AM STUCK NEED HELP P...
Questions
question
Physics, 06.05.2020 01:26
question
Mathematics, 06.05.2020 01:26
question
Mathematics, 06.05.2020 01:26
Questions on the website: 13722361