Search code examples
pythonlisttuplesflatten

How to flatten a tuple in python


I have the following element of a list, and the list is 100 elements long.

[(50, (2.7387451803816479e-13, 219))]

How do I convert each element to look like this?

[(50, 2.7387451803816479e-13, 219)]

Solution

  • [(a, b, c) for a, (b, c) in l]
    

    Tuple packing and unpacking solves the problem.