Discuss / Python / not so simplied compared to str(n)==str(n)[::-1]

not so simplied compared to str(n)==str(n)[::-1]

Topic source

import math

def int2str(n): l=[] while n>0: l.append(int(n%10)) n=(n-n%10)/10
return l

def symmetry(n): strn=int2str(n) lengt=math.floor(len(strn)/2) k=1

while k<=lengt:
    if (strn[k-1]==strn[-k]):
        k=k+1
    else:
        break
if k>lengt:
    return True

def listsys(k): iter=list(filter(sysmytric,range(k))) print(iter)

print (listsys(100000))


  • 1

Reply