I have a list of lists such as : [[foo,1],[baz,1],[foo,0],[bar,3],[foo,1],[bar,2],[baz,2]]. I want to get all the different items in the inner lists and find the total number of them. I mean the result should be like : [[foo,2],[bar,5],[baz,3]]. How can I do this task?
Using Counter looks good, but it will work only with python >= 2.7. The problem with your question is that there is no python code. Hint: start with a program which prints each list item on a different line.