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]