+ 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 Réponse
+ 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
Aujourd'hui en vedette
.
1 Votes
What?
0 Votes
HTML
0 Votes
Quiz duel
0 Votes
Web
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes