Skip to content
Advertisement

How to make two lists out of two-elements tuples that are stored in a list of lists of tuples

I have a list which contains many lists and in those there 4 tuples.

JavaScript

I want them in two separate lists like:

JavaScript

my attempt was using the map function for this.

JavaScript

but this is giving me an error:

JavaScript

Advertisement

Answer

Your approach is quite close, but you need to flatten first:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement