subject

Part 1: Review the Code Review the code and locate the comments with missing lines (# Fill in missing code). Copy and paste the code into the Python IDLE. Use the IDLE to fill in the missing lines of 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 linesdef 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 tookmain()

Part 2: Test Your Code
Use the Python IDLE to test the program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Run your program to ensure it is working properly. Fix any errors you observe.
Example of expected output: The output below is an example of the output from the Guess the Number game. Your specific results will vary based on the input you enter.
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 08:50
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
question
Computers and Technology, 22.06.2019 14:40
You are working with a professional edition organization. they wish to install the expense tracker which requires the use of 4 custom tabs, 3 custom objects, and one custom app. if the company is already using 4 applications, 36 custom objects, and 7 custom tabs, what will happen when they try to install expense tracker?
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, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
You know the right answer?
Part 1: Review the Code Review the code and locate the comments with missing lines (# Fill in missi...
Questions
question
Mathematics, 01.02.2021 14:00
question
English, 01.02.2021 14:00
question
Mathematics, 01.02.2021 14:00
question
Mathematics, 01.02.2021 14:00
question
Mathematics, 01.02.2021 14:00
question
Mathematics, 01.02.2021 14:00
Questions on the website: 13722360