Discuss / Python / 拙见

拙见

Topic source

-

#1 Created at ... [Delete] [Delete and Lock User]
def filter_2(n):    str_1=str(n)    # 上面的操作把整型转换成一个字符串,无法使用列表来判断相等,但是可以用索引来判断正反是否相等    # if str_1[n] == str_1[len(str)-n]:    if str_1 == str_1[::-1]:        print(n)        return int(str_1)for i in range(1,1000):    filter_2(i)

  • 1

Reply