import random guesses = 0 rounds = 3 user_score = 0 computer_score = 0 round_win = True round = 1 print("Welcome to the Number Wizard Game") name = input("What is your name? ") print("Hello {}. \nIn this game you need to guess the random number between 1 and 1000 in as little guesses as posssible...".format(name)) print() print("If you can pick the number in less than 10 guesses you win! we will play a best of 3 games") print() for i in range(1, rounds + 1): correct_number = random.randint(1, 100) print(correct_number) round_win = False guesses = 0 print() print("Welcome to round {}".format(round)) print("{} score is: {}".format(name, user_score)) print("Computerscore is: {}".format(computer_score)) for i in range(0, 11): print() pick = int(input("Please guess a number: ")) if pick == correct_number: print("You picked the right number!") round_win = True guesses = 10 elif guesses < 9: if pick < correct_number: print("You need to pick higher") else: print("You need to pick lower") else: print("Out of guesses") if round_win == True: user_score += 1 else: computer_score += 1 round += 1 if user_score == 2 or computer_score == 2: break if computer_score > user_score: print("You loose") else: print("You win")