import random

min_num = 1
max_num = 10

guesses_allowed = 5

secret_num = random.randint(min_num, max_num)

print("Welcome to the number guessing game!")
print(" Choose two numbers between {min_num} and {max_num}")

for i in range(guesses_allowed):
  guess = int(input("Enter your guess "))

  if guess == secret_num:
    print("Congratulations you won")
    break
  elif guess > secret_num:
    print("Your number is high")
  else:
    print("Your number is low")

  guesses_remaining = guesses_allowed - (i + 1)
  print("You have {guesses_remaining} guesses left.")

if i == guesses_allowed - 1:
  print("Unfortunately, you lost! The password3 is {secret_num}")

play_again: str = input("Do you want to play again? (Yes/No):")
if play_again. lower()!= "Yes":
  print("Fine! I'll generate a new random number.")