Let's say you have a list as follows:
[1,1,1,2,3,1,1,5,6,6,10]
What I would like to do, using the standard Python libraries (i.e., not numpy), is sum together any immediate duplicates. Summing the two groups of 1s and the group of 6s, the result should be (emphasis added to where summing occurs):
[**3**,2,3,**2**,5,**12**,10]
How can this be accomplished?