Answers for "val concat : 'a list list -> 'a list"

2

python concatenate list of lists

x = [["a","b"], ["c"]]

result = sum(x, [])
Posted by: Guest on July-04-2020
0

Concatenate lists

>>> a = [1, 2, 3]
>>> b = [4, 5, 6]
>>> c = a + b
>>> print(c)
[1, 2, 3, 4, 5, 6]
Posted by: Guest on October-21-2021
0

how to concatenate all list inside list

>>> x = [["a","b"], ["c"]]
>>> [inner
...     for outer in x
...         for inner in outer]
['a', 'b', 'c']
Posted by: Guest on October-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language