113,912 views
34 votes
34 votes
You have a plan for a program. Match the planning comment to the code that executes that part of the plan.

# Create a loop that continues until the user guesses the number.

# Get a guess from the user and update the number of guesses.

# Compare the guess to the correct answer.


guess = mput Guess an integer from 1 to 10: *)

quess = intouess)

attempts = attempts + 1


if guess == comect.

 Tell the user the guess was conect print"You were conectr

keepGoing = False

ese

print"You were wrong.")


keepGong = True

while keepGoing:

You have a plan for a program. Match the planning comment to the code that executes-example-1
User Sbridges
by
3.0k points

1 Answer

14 votes
14 votes

Answer:

1. Create a loop that continues until the user guesses the number.

  1. while keepGoing:

2. Get a guess from the user and update the number of guesses.

  1. guess = input("Guess an integer from 1 to 10: ")
  2. guess = int(guess)
  3. attempts = attempts + 1

3. Compare the guess to the correct answer.

  1. if guess == correct:
  2. print("You were correct.")
  3. keepGoing = False
  4. else:
  5. print("You were wrong.")
  6. keepGoing = True
User Tcbcw
by
3.3k points