why is python string split() not splitting

后端 未结 3 2092
执笔经年
执笔经年 2020-11-27 23:34

I have the following python code.

class MainPage(BaseHandler):

    def post(self, location_id):
        reservations = self.request.get_all(\'reservations\'         


        
3条回答
  •  -上瘾入骨i
    2020-11-28 00:07

    split does not split the original string, but returns a list

    >>> r  = 'court2 13 0 2012 9 2'
    >>> r.split(' ')
    ['court2', '13', '0', '2012', '9', '2']
    

提交回复
热议问题