import random
chances = 0
while True:
    # generating random number between
    value = random.randint(1,5)
  
    # taking guessing number as input
    guess = int(input("Guess a number:- "))
    # Condition testing
    if value == guess:
        print("Congratulations! You guessed the number correctly")
        break
    elif value != guess  :
        print("Wrong guess. Try again!")
chances += 1