python代码如下
import math
def isprime(n):
if n<=1:
return False
if n==2:
return True
if n%2==0:
return False
for i in range(3,int(math.sqrt(n))+1,2):
if n%i ==0:
return False
return True
def reverse_number(n):
return int(str(n)[::-1])
number = list(map(int,input().split()))
a = number[0]
b = number[1]
for i in range(a,b+1):
if i == reverse_number(i):
if isprime(i):
print(i)