-1

Possible Duplicate:
Making a flat list out of list of lists in Python

I have a list like:

[['22', '14']]

How can I transform it to:

[22, 14]

Thank you.

Community
  • 1
  • 1
tchike
  • 154
  • 4
  • 21
  • 3
    http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python – avasal Aug 31 '12 at 09:09

3 Answers3

8
L = [['22', '14']]
M = [ int(i) for i in L[0] ]
Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
7
a = [['22','14']]
map(int, a[0])
gefei
  • 18,922
  • 9
  • 50
  • 67
3
>>> lis=[['22', '14']]
>>> map(int,sum(lis,[]))
[22, 14]
Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504