fork download
  1. from functools import reduce
  2. import operator
  3.  
  4. d = [[1],[2],[3],[3]]
  5. flattened_list = sum(d, [])
  6. print(flattened_list)
  7.  
  8. flattened_list = reduce(operator.concat, d)
  9. print(flattened_list)
Success #stdin #stdout 0.02s 9276KB
stdin
Standard input is empty
stdout
[1, 2, 3, 3]
[1, 2, 3, 3]