Discuss / Python / 看不懂在除什么

看不懂在除什么

Topic source

yan32777

#1 Created at ... [Delete] [Delete and Lock User]

def is_palindrome(n):

    strn=str(n)

    strn=strn[::-1]

    nf=int(strn)

    return n==nf

GG

#2 Created at ... [Delete] [Delete and Lock User]

判断回文数啊,123

123→字符串化→"123"→字符串倒序→"321"→数值化→321


  • 1

Reply