+ 2

How to select elements at 0th position from 2d lists

Assume a 2d list in python. How would you select all the elements present in first coloumn and add them to another list.

30th Jun 2019, 6:11 PM
Manoj Kumar
Manoj Kumar - avatar
1 Resposta
+ 4
firstcol = [r[0] for r in list2d] https://code.sololearn.com/cvisCTyjf4A3/?ref=app
30th Jun 2019, 6:22 PM
Tibor Santa
Tibor Santa - avatar