import random import time print("welcome to this game today you will be guessing a number between 0-1000, you will have a max of 10 tries per round and a total of 3 round. good luck!!!") time.sleep (4) def play_game(): target_number = random.randint(0, 1000) max_guesses = 10 rounds = 3 for round in range(1, rounds + 1): print(f"Round {round}:") for attempt in range(1, max_guesses + 1): guess = int(input("Enter your guess (between 0 and 1000): ")) if guess < target_number: print("Too low!") elif guess > target_number: print("Too high!") else: print("Congratulations! You guessed it!") break else: print(f"Sorry, you've used all {max_guesses} guesses. The correct number was {target_number}.") if round < rounds: play_again = input("Do you want to play again? (yes/no): ").lower() if play_again != "yes": break else: target_number = random.randint(0, 1000) else: print("End of game.") break play_game()