I have a data which looks like this,
I want to collect the data, but while collecting I want to count them as well
So the the output should look somewhat like this.
I tried putting it as a dictionary but then I am loosing the order in the data.
Please help me I have been trying this for a long time...