I'm trying to figure out a way to remove the "duplicate" tuples from my list while also accumulating their "values". The tricky part is that they're not necessary true duplicates nor true values so what's the best approach?
Would it be easier to just try and convert my list into a dictionary?
My list of tuples:
lst = [('bday', 1), ('ramen', 2), ('cake', 1), ('ramen', 1), ('cake', 2), ('ramen', 1)]
Expected Output:
({'cake': 3, 'birthday': 1, 'ramen': 4})