Discuss / Python / 交作业

交作业

Topic source

老帕小帕

#1 Created at ... [Delete] [Delete and Lock User]
def is_palindrome(n):
    n=str(n)
    return n[:] ==n[::-1]

好厉害

return n[:] ==n[::-1] 这里的n[::-1]是指反着过来顺序的序列吗?前面切片那里貌似也没提到这么用啊

懂了,太6了


  • 1

Reply