Answer:
1. Create a loop that continues until the user guesses the number.
- while keepGoing:
2. Get a guess from the user and update the number of guesses.
- guess = input("Guess an integer from 1 to 10: ")
- guess = int(guess)
- attempts = attempts + 1
3. Compare the guess to the correct answer.
- if guess == correct:
- print("You were correct.")
- keepGoing = False
- else:
- print("You were wrong.")
- keepGoing = True