I have two lists, similar to these
listA = ['apples','apples','oranges','pears','pears','watermelons','..']
listB = ['apples','oranges','pears','watermenols','...']
So the listA has just a list of fruits, where potential duplicates are in a row. The listB has each fruit, but only once and in the same order as listA.
Is it possible to count (and print) the number of each fruit, for example like this apples 2 orange 1 pears 1 etc
I think you could do it with two loops, but I'm not quite sure how the loops should be...
edit: This should be done WITHOUT any fancy imports and stuff, so just the basics like loops and lists
thanks! :)