""" ------------------------------------------------- Project: Take-away game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Sean sajota Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ import random set reset_guess = 0 rounds = 3 user_score = 0 AI_score = 0 round_won = True round = 3 round_number = 1 guess = 10 print("Take-Away game! ") name=input("what is your name?") print("Welcome!", name ,"This is the Take-Away game.To play this you have to guess a number between 1-1000 and you will have 10 guesses per round. ") while round_number <= rounds: print("\nGame ", round_number, " start!") secret_number = random.randint(1, 1000) attempts = 10 for attempt in range(1, attempts + 1): try: guess = int(input("Attempt "+str(attempt)+"/"+str(attempts)+": pick a number!: ")) except ValueError: print("This number is unnacceptable please put a proper number.") continue def play_round(player_name,round_number): secret_number = random.randint(1,1000) attempts_left = 10 attempt = 0 user_score = 0 guessed_correctly = False while attempts_left > 0: print(f"\nRound {round_number}: You have {attempts_left} attempts left.") guess = int(input("Your guess: ")) guess = int(guess) if guess == secret_number: print("Congratulations, ", name, "! You guessed the number in ", attempt, "attempts.") user_score += 1 break elif guess < secret_number: print("try a higher number.") else: print("Too high! Try a lower number.")