Import Random
Import Random
def number_guessing_game():
"""Plays a number guessing game with the user."""
lower_bound = 1
upper_bound = 100
secret_number = random.randint(lower_bound, upper_bound)
attempts = 0
max_attempts = 7 # Limit the number of guesses
else: # This 'else' block executes if the loop completes without a 'break'
(i.e., attempts run out)
print(f"Sorry, you ran out of attempts. The secret number was
{secret_number}.")
if __name__ == "__main__":
number_guessing_game()