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, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
question
Computers and Technology, 24.06.2019 17:00
Anew author is in the process of negotiating a contract for a new romance novel. the publisher is offering three options. in the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. in the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold. in the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000. the author has some idea about the number of copies that will be sold and would like to have an estimate of the royal- ties generated under each option. write a program that prompts the author to enter the net price of each copy of the novel and the estimated number of copies that will be sold. the program then outputs he royalties under each option and the best option the author could choose. (use appropriate named constants to store the special values such as royalty rates and fixed royalties.
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
Mathematics, 17.01.2020 13:31
question
Mathematics, 17.01.2020 13:31
question
Chemistry, 17.01.2020 13:31
Questions on the website: 13722360