how do I return list with separate character

前端 未结 0 852
闹比i
闹比i 2021-02-10 10:56

I have a string s = \'10001001\'. When I use:

return [s[i:i+4] for i in range(0, len(s), 4)]

it returns

[\'1000\',\'1001\']


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题