Python How To Get First Element In A

[Solved] Python How To Get First Element In A | Haskell - Code Explorer | yomemimo.com
Question : get first element list of tuples python

Answered by : creepy-cat-7enp8qf9o9bq

>>> a = [(1, u'abc'), (2, u'def')]
>>> [i[0] for i in a]
[1, 2]

Source : https://stackoverflow.com/questions/12142133/how-to-get-first-element-in-a-list-of-tuples | Last Update : Thu, 12 May 22

Question : get first element of tuple python

Answered by : 68duck

firstItem = tupple[0]

Source : | Last Update : Sat, 03 Apr 21

Answers related to python how to get first element in a list of tuples

Code Explorer Popular Question For Haskell