标签: python list
简单的问题。 你会如何转换这样的列表:
["foo","banana","apple"]
进入
[["foo"],["banana"],["apple"]]
谢谢!
答案 0 :(得分:7)
>>> [[el] for el in ["foo","banana","apple"]] [['foo'], ['banana'], ['apple']]