Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 从 Python 中的列表列表中制作一个平面列表
我有一个类似的列表:
[['22', '14']]
我怎样才能将其转换为:
[22, 14]
谢谢你。
L = [['22', '14']] M = [ int(i) for i in L[0] ]
a = [['22','14']] map(int, a[0])
>>> lis=[['22', '14']] >>> map(int,sum(lis,[])) [22, 14]