title: How to generate a list of palindrome numbers within a given range?
body: <p>Let's say the range is : <strong>1</strong> ≤ <strong><code>X</code></strong> ≤ <strong>120</strong></p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>&gt;&gt;&gt; def isPalindrome(s):
      ''' check if a number is a Palindrome '''
      s = str(s)
      return s == s[::-1]
  
  &gt;&gt;&gt; def generate_palindrome(minx,maxx):
      ''' return a list of Palindrome number in a given range '''
      tmpList = []
      for i in range(minx,maxx+1):
          if isPalindrome(i):
              tmpList.append(i)
  
      return tmpList
  
  &gt;&gt;&gt; generate_palindrome(1,120)
  
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111]
  </code></pre>
  
  <p>However, this is <code>O(n)</code>. </p>
  
  <p>How do I improve this algorithm to make it faster ?</p>
  
  <p><em>PS. This is Python 2.7</em></p>