Answers for "flaten a python nested list"

9

flatten a list of lists python

flattened = [val for sublist in list_of_lists for val in sublist]
Posted by: Guest on May-04-2020
1

python nested list

L = [[1, 2, 3],[4, 5, 6],[7, 8, 9]]   
for list in L:
    for number in list:
        print(number, end=' ')
# Prints 1 2 3 4 5 6 7 8 9
Posted by: Guest on January-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language