I have a dictionary with the key values like this.
>>>dict.keys()
[('4', '12'), (('8', '9'), ('10', '11')), (('8', '10'), ('12', '14')), (('10', '11'), ('14', '15'))]
I want to format the key values so that it looks like this.
>>>dict.keys()
[('4', '12'), ('8', '9', '10', '11'), ('8', '10', '12', '14'), ('10', '11', '14', '15')]
The inner brackets are removed in the expected output. I tried converting the keys to a list and then formatting the values, but it didn't give the expected output.
Thanks.
EDIT
The values in the dictionary corresponding to the keys remain the same. Also, I want to change the key formatting directly in the dictionary instead of converting it to a list as this raises error in other parts of the code.
Input dictionary:
{('4', '12'): '-100', (('8', '9'), ('10', '11')): '10--', (('8', '10'), ('12', '14')): '1--0', (('10', '11'), ('14', '15')): '1-1-'}
Expected Output Dictionary:
{('4', '12'): '-100', ('8', '9', '10', '11'): '10--', ('8', '10', '12', '14'): '1--0', ('10', '11', '14', '15'): '1-1-'}