Discuss / Python / 啊加一,为啥不对啊只去除最开始的空格吗?

啊加一,为啥不对啊只去除最开始的空格吗?

Topic source

在下是个S

#1 Created at ... [Delete] [Delete and Lock User]
if len(s)==0:    return selse:    while s[0:1]==' ':        s=s[2:]    while s[-2:-1]==' ':        s=s[0:-2]return s

  • 1

Reply