G
G
GreenX52020-09-11 22:25:38
Python
GreenX5, 2020-09-11 22:25:38

How to sum the elements of a list of lists without a generator?

There is a list of lists Please tell me a short one-line way to add the second elements of nested lists to get a total of 3. Without multi-line for.

llist =

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Pokrovsky, 2020-09-11
@GreenX5

llist = 

result = sum(i for _, i in llist)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question