python学习打卡 0214 果然不同人的解法不一样,膜拜大家,学习了!
Topic sourceif s != '': while bool(s) and s[0] == ' ': s = s[1:] while bool(s) and s[-1] == ' ': s = s[:-1] return selse: return ''
- 1
if s != '': while bool(s) and s[0] == ' ': s = s[1:] while bool(s) and s[-1] == ' ': s = s[:-1] return selse: return ''
用户6776087169
while s!='' and s[0]==' ':
s=s[1:]
while s!='' and s[-1]==' ':
s=s[:-1]
return s