1. 程式人生 > >python 求200以內平方為迴文數的N的值

python 求200以內平方為迴文數的N的值

for n in range (1,201):
    sq = n*n
    str_sq = str(sq)
    str__sq = str_sq[::-1]
    #把字串倒序
    if str_sq == str__sq:
        print (n)
    

總算明白別人說C是母語是怎麼回事....

按原來的思路搗鼓一遍之後才曉得,居然還可以這樣寫啊....