Discuss / Python / 都写在一个while里面

都写在一个while里面

Topic source

pipi-hongwy

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

    while(s[:1]==' ' or s[-1:]==' '):

        if(s[0]==' '):

            s=s[1:]

        if(s[-1]==' '):

            s=s[:-1]

    return s


  • 1

Reply