Discuss / Python / 交作业20200129 2120

交作业20200129 2120

Topic source

>>> def trim(s):

...     while s!='' and s[0]==' ':

...             s=s[1:]

...     while s!='' and s[-1]==' ':

...             s=s[:-1]

...     return s


  • 1

Reply