Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get first element list of tuples python

>>> a = [(1, u'abc'), (2, u'def')]
>>> [i[0] for i in a]
[1, 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #element #list #tuples #python
ADD COMMENT
Topic
Name
9+8 =