title: Print out a list of prime numbers in python
body: <p>The question is: print out all numbers from 1 to 1000 that satisfy the two conditions:</p>
  <ol>
  <li>Those are prime numbers</li>
  <li>The numbers after being reversed are also prime numbers.
  e.g., 13 satisfies (as 13 and 31 are prime numbers), but 19 does not satisfy (19 is a prime number, while 91 is not).
  My codes:</li>
  </ol>
  <pre><code>def prime(n):
    if n&lt;2:
      return False
    for i in range(1, n):
      if n%i == 0:
        return False
    else:
      return True
  
  def reverse(n):
    List = []
    while n&gt;0:
      List.append(n%10)
      n = n//10
  
    string = [str(integer) for integer in List]
    a_string = &quot;&quot;.join(string)
    result = int(a_string)
    print(result)
  
  L = []
  for i in range (1, 1000):
    if prime(i) == prime(reverse(i)) == True:
      L.append(i)
  print(L)
  
  </code></pre>
  <p>Mine seems to contain some errors as the outcome is not as expected, either it shows none or still shows 19 in the list.
  Thank you in advance!</p>