def fil(n): L = [] t = str(n) for m in t: L.append(m) x, y = 0, -1 while L[x] == L[y]: x, y = x + 1, y - 1 if x < len(L): continue else: x, y = 0, 1 return True return False
output = filter(fil, range(1, 1000)) print(list(output))
Sign in to make a reply
骑着单车去追梦20160428
def fil(n): L = [] t = str(n) for m in t: L.append(m) x, y = 0, -1 while L[x] == L[y]: x, y = x + 1, y - 1 if x < len(L): continue else: x, y = 0, 1 return True return False
output = filter(fil, range(1, 1000)) print(list(output))