I have a list in a file of different animals which is opened and read in a function.
For example my list is:
Cats, Dogs, Cows, Cows, Cows, Sheep, Dogs, Sheep, etc.
How do I put these in a list which will group the same animals together and return the number of each animal in the list, for example for this list I want:
List = (1, 2, 3, 2)
This will then enable me to work out the length of this new list and give how many different animals there are.
Without using sets if possible.
Also, because it is in a function I cant be specific about each animal.