1>>> def isPalindrome(s):
2 ''' check if a number is a Palindrome '''
3 s = str(s)
4 return s == s[::-1]
5
6>>> def generate_palindrome(minx,maxx):
7 ''' return a list of Palindrome number in a given range '''
8 tmpList = []
9 for i in range(minx,maxx+1):
10 if isPalindrome(i):
11 tmpList.append(i)
12
13 return tmpList
14
15>>> generate_palindrome(1,120)
16
17[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111]
18