小编k3n*_*t1c的帖子

如何在Python中拆分字符串列表

说我有一个像这样的字符串列表:

list = ["Jan 1", "John Smith", "Jan 2", "Bobby Johnson"]
Run Code Online (Sandbox Code Playgroud)

如何将它们分成两个单独的列表?我的老师提到了关于索引的一些内容,但没有很好地解释它

li1 = ["Jan 1", "John Smith"]
li2 = ["Jan 2", "Bobby Johnson"]
Run Code Online (Sandbox Code Playgroud)

python list python-3.x

0
推荐指数
1
解决办法
81
查看次数

标签 统计

list ×1

python ×1

python-3.x ×1