How to concatenate two lists in python?
I have two lists and want to have a list that contaions all the items from the two lists. I know how to do it using a for loop, but I feel like there is a simpler way.
I have two lists and want to have a list that contaions all the items from the two lists. I know how to do it using a for loop, but I feel like there is a simpler way.
A very practical way would be to use list comprehension:
[elem for list in metalist for elem in list]
, where metalist = [list_1, list_2, ..., list_n]
Just drop us an email to ...
Show more