下面是两个函数都是做回文检测的,isP()是精简版,isP1()是解析版.
def isP(s):
if len(s)<=1:return True
else:return s[0]==s[-1] and isP(s[1:-1])
def isP1(s,indent):
print indent,"A",s
if len(
下面是两个函数都是做回文检测的,isP()是精简版,isP1()是解析版.
def isP(s):
if len(s)<=1:return True
else:return s[0]==s[-1] and isP(s[1:-1])
def isP1(s,indent):
print indent,"A",s
if len(