The tuple that length is equal to 6 is correct one while the tuples with shorter length are artefacts that should be joined to give length of 6.
For example:
I have a list of tuples as below:
foo = [(3, 1, 0, 1, 1, 1), (3, 1), (1, 1), (3, 1), (3, 1, 0, 1), (1, 2), (3, 3, 3, 1, 2, 2)]
len(foo[0]) = 6
len(foo[1]) = 2
len(foo[2]) = 2
len(foo[3]) = 2
len(foo[4]) = 4
len(foo[5]) = 2
len(foo[6]) = 6
So it means that I want to have a list with the following output:
foo_1 = [(3, 1, 0, 1, 1, 1), (3, 1, 1, 1, 3, 1), (3, 1, 0, 1, 1, 2), (3, 3, 3, 1, 2, 2)]
where:
foo_1[1] = foo[1] + foo[2] + foo[3],
foo_1[2] = foo[4] + foo[5]
Basically, I need to iterate over list of tuples and compare the length of each with 6. Then if the length of tuple is not equal to six I have to join tuples till their length will be 6.