I would like to transform a list, for example:
A = [((1, 1), (1, 1, 1, 1)),
((1, 1), (1, 1, 1, 1)),
((1, 1), (1, 1, 1, 2)),
((1, 1), (1, 1, 1, 3)),
((1, 1), (1, 1, 2, 1)),
((1, 1), (1, 1, 3, 1)),
((1, 1), (1, 2, 1, 1)),
((1, 1), (1, 2, 1, 2)),
((1, 1), (1, 2, 1, 3)),
((1, 1), (1, 3, 1, 1)),
((1, 1), (1, 3, 1, 2)),
((1, 1), (1, 3, 1, 3))]
into
A = [((1, 1, 0), (1, 1, 1, 1)),
((1, 1, 0), (1, 1, 1, 1)),
((1, 1, 0), (1, 1, 1, 2)),
((1, 1, 1), (1, 1, 1, 3)),
((1, 1, 1), (1, 1, 2, 1)),
((1, 1, 1), (1, 1, 3, 1)),
((1, 1, 2), (1, 2, 1, 1)),
((1, 1, 2), (1, 2, 1, 2)),
((1, 1, 2), (1, 2, 1, 3)),
((1, 1, 3), (1, 3, 1, 1)),
((1, 1, 3), (1, 3, 1, 2))]
Any suggestions?