Categories
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 =
llist =
Answer the question
In order to leave comments, you need to log in
llist = result = sum(i for _, i in llist)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question