""" ------------------------------------------------- Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: VENUSHA GIMHAN MADAWALAGE Date: 07/03/2025 Python: 3.5 ------------------------------------------------- """ import random resrt_guesses = 0 rounds = 3 user_score = 0 Ai_score = 0 round_won = True round = 1 print("Welcome to the Take-Away Game!") name = input("Enter your name: ") print() for round_num in range(1, rounds + 1): print("Round", round_num) target_number = random.randint(1, 1000) for attempt in range(1, 11): guess = int(input("Guess a number between 1 and 1000: ")) if guess == target_number: print("Correct! You guessed the right number.") user_score += 1 round_won = True break elif guess < target_number: print("Too low! Try again.") else: print("Too high! Try again.") else: print("The correct number was", target_number) Ai_score += 1 round_won = False print() if round_num == rounds: break print() print("Final score:", name, user_score, "-", "Computer", Ai_score) print() if user_score > Ai_score: print("Congratulations", name, "you win!") else: print("Sorry, the computer wins.")