You're very close with this. Your while loop condition needs to be extended so that it doesn't just look at whether the number matches the guess. It also needs to check to see whether you have gone past the maximum number of allowed tries. Rearrange your while clause like this:
found = false
while (found == false and tries < max_tries_allowed)
guess = int(input("Take a guess: "))
tries += 1
if (guess = the_number):
found = true
if (guess > the_number):
print("Lower...")
elif (guess < the_number):
print("Higher...")
else:
found = true
if (found == false):
print("You didn't find the number")
Something like that should help.