subject

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 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Communication is the exchange of information. true false
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
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
Mathematics, 06.12.2020 20:30
Questions on the website: 13722360