Group items in a list by two’s — Python

后端 未结 0 560
萌比男神i
萌比男神i 2021-01-16 12:11

Say I’ve got a list

ls = [1,2,3,4,5,6]

And I’d like to get this result:

res = [[1,2],[3,4],[5,6]]

What’s the

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