-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
  • 124
  • 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
  • 328,850
  • 93
  • 598
  • 514
7
a = [['22','14']]
map(int, a[0])
gefei
  • 18,124
  • 7
  • 49
  • 65
3
>>> lis=[['22', '14']]
>>> map(int,sum(lis,[]))
[22, 14]
Ashwini Chaudhary
  • 232,417
  • 55
  • 437
  • 487