Python Program to Flatten a Nested List Using in-build Sum() Function
#Flatten a Nested List in python Using In-build sum() function list = [[11, 22, 33, 44], [55, 66, 77], [88, 99]] #we are using a python In-build sum() function flatList = sum(list, []) # Output print('New list', flatList)
Output:
New list [11, 22, 33, 44, 55, 66, 77, 88, 99]