我有以下格式的列表:
[[[u'Hot Dogs', u'hotdog'], [u'Food Stands', u'foodstands']], [[u'Scandinavian', u'scandinavian'], [u'Breakfast & Brunch', u'breakfast_brunch'], [u'Coffee & Tea', u'coffee']], [[u'Burgers', u'burgers']]]
我想从每个列表中删除第一项(它只是第二项的副本),然后返回这些单个标记的简单列表,而不是包含在multiple[]中。我该怎么做呢?你知道吗
编辑:我想返回一个列表列表,每一行代表下面提到的每个列表中的第二个标记
我想你想要的是:
输出如下:
您可以使用list comprehesion以简单的方式完成:
其中
l
是您指定的列表。你知道吗相关问题 更多 >
编程相关推荐