def test_palindrome(num):
	return str(num) == str(num)[::-1]

def palindromes(max_factor, min_factor):
	for i in range(min_factor, max_factor+1):
		for j in range(min_factor, i+1):
			if test_palindrome(i*j):
				yield (i*j, (i,j))

def smallest_palindrome(max_factor, min_factor=0):
	return min(palindromes(max_factor,min_factor))

def largest_palindrome(max_factor, min_factor=0):
	return max(palindromes(max_factor, min_factor))


