I have a list that looks like this:
lst = [(1,'X1', 256),(1,'X2', 356),(2,'X3', 223)]
The first item of each tuple is an ID and I want to marge the items of each tuple where the ID is the same. For example I want the list to look like this:
lst = [(1,('X1','X2'),(256,356)),(2,'X3',223)
How do I do this the easiest way?
I have tried some solutions based on own logic but it did not work out.