Discuss / Python / 用递归方法交回作业吧

用递归方法交回作业吧

Topic source

Confidendure

#1 Created at ... [Delete] [Delete and Lock User]
在此插入代码

def is_palindrome(n): return fn(n,0)==n

def fn(num,result): if(num==0): return result return fn(num//10,num%10+result*10)


  • 1

Reply