import random

MIN_NUM = 1
MAX_NUM = 10
MAX_GUESSES = 10

def processGuessingNumber():
    stillGuessingNum= True
    guessedNumber = False
    actualNum = -1
    playNum = -1
    i = 1
    actualNum = random.randrange(MIN_NUM,MAX_NUM)+1
    while (stillGuessingNum == True):
        print("Guess a # from %d-%d: " %(MIN_NUM,MAX_NUM), end="") 
        playerNum = int(input())
        if (actualNum == playerNum):
            print("Guessed %d!" %(actualNum))
            stillGuessingNum = False
            guessedNumber = True
        i = i + 1
        if (i > MAX_GUESSES):
            stillGuessingNum = False
            guessedNumber = False
            print("Exceeded maximum tries of %d" %(MAX_GUESSES))
    return(guessedNumber)

print(processGuessingNumber())
