Question: 
Write a function to find the previous palindrome of a specified number.


Model's Code:
def previous_palindrome(n):
    def is_palindrome(num):
        return str(num) == str(num)[::-1]
    
    if n <= 10:
        return n - 1
    
    n -= 1
    while not is_palindrome(n):
        n -= 1
    return n



Sample Correct Code:
def previous_palindrome(num):
    for x in range(num-1,0,-1):
        if str(x) == str(x)[::-1]:
            return x


Asserts:
assert previous_palindrome(99)==88
assert previous_palindrome(1221)==1111
assert previous_palindrome(120)==111


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 909 of 974: 701/909 (77.11771177117713%): success