Discuss / Python / 嘻嘻

嘻嘻

Topic source

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

无风之名

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

while (s[0]==' '): IndexError: string index out of range 你的代码怎么运行是这个结果?


  • 1

Reply