0

简单的问题。你将如何转换这样的列表:

["foo","banana","apple"]

进入

[["foo"],["banana"],["apple"]]

谢谢 !

4

1 回答 1

7
>>> [[el] for el in ["foo","banana","apple"]]
[['foo'], ['banana'], ['apple']]
于 2013-03-22T11:45:45.527 回答