0

I have a list of floats in random number like this:

float_list=[7.1, 7.1, 8.3, 8.5, 6.7,6.8, 6.9, 4.0, 4.2, 9.0]

I want to organize the list with tuples as below:

float_list=[(7.1, 7.1, 8.3, 8.5), (6.7, 6.8,6.9), (4.0, 4.2, 9.0)]

I tried using group_by method from itertools but could not get the expected results. I have indedd see this solution but this is not what i'm asking,I have float with varying deltas.

0 Answers0