九州体育网 - 十年信誉网站

关于作者

Discuss / Python / 作业

作业

Topic source

又耳日宣火韦

#1 Created at ...

def trim(s): if len(s)==0: return '' else: while s[:1]==' ': s=s[1:] while s[-1:]==' ': s=s[:-1] return s

magicla_icy

#2 Created at ...

用户6164069094

#3 Created at ...

再改良~

def trim(s): if s!='': while s[:1]==' ': s=s[1:] while s[-1:]==' ': s=s[:-1] return s


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.