Discuss / Python / 提问

提问

Topic source

褴褛衣

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

def trim(s):

if(s==''):

return s

if(s[0]!='' and s[-1]!=''):

return s

elif s[0]=='':

trim(s[1:])

elif s[-1]=='':

trim(s[:-1])

print(s)

想问问这个为什么不对啊


  • 1

Reply