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

关于作者

Discuss / Python / for in 循环

for in 循环

Topic source

神奇的幽灵1

#1 Created at ...
for str1 in s:               
    if s[:1] == ' ':
       s = s[1:]
    elif s[-1:] == ' ':
       s = s[:-1]
    else:
       break
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.