I just learn python for not long. And I had try my best to represent my data looks better just like showing before. Now I have some tuple data type which look like this:
('John', '5', 'Coke')
('Mary', '1', 'Pie')
('Jack', '3', 'Milk')
('Mary', '2', 'Water')
('John', '3', 'Coke')
And I wanna count how many items that each one had bought.
Assume that the different name is different person.
So how could I do in order to get some information like this below:
John: 8 Coke
Mary: 1 Pie
Mary: 2 Water
Jack: 3 Milk
I have no idea how could I do now. I can't come up with any method even the stupid one.
tuplesare a tuple of tuples? Or there are different tuples?