怎么改正最后的地方一直不对
a = int(input())
b = []
n = 1
while len(b) < a:
n = n + 1
if (n>10) and (str(n) != str(n)[::-1]):
for i in range(1,n):
if n % i == 0:
x = i
else:
if x == 1:
c = str(n)[::-1]
for j in range(1,int(c)):
if int(c) % j == 0:
y = j
else:
if y == 1:
b.append(str(n))
print("{}".format(" ".join(b)),end=" ")