Hi
Given the following list
['Jellicle', 'Cats', 'are', 'black', 'and', 'white,', 'Jellicle', 'Cats', 'are', 'rather', 'small;', 'Jellicle', 'Cats', 'are', 'merry', 'and', 'bright,', 'And', 'pleasant', 'to', 'hear', 'when', 'they', 'caterwaul.', 'Jellicle', 'Cats', 'have', 'cheerful', 'faces,', 'Jellicle', 'Cats', 'have', 'bright', 'black', 'eyes;', 'They', 'like', 'to', 'practise', 'their', 'airs', 'and', 'graces', 'And', 'wait', 'for', 'the', 'Jellicle', 'Moon', 'to', 'rise.', '']
I am trying to count how many times each word appears and display the top 3.
BUT....I am only looking to find the top three that have the first letter capitalised. Ignore all words that do not have the first letter capitalised.
I am quite new to programming so please try and do it in the most barebones fashion.
I am sure there is a better way than this...but my idea was to do the following
- put the first word in the list into another list called uniquewords
- delete the first word and all its duplicated from the original list
- add the new first word into unique words
- delete the first word and all its duplicated from original list. 5. 6. etc. until the original list is empty.
then 7. count how many times each word in uniquewords appears in the original list 8. find top 3 and print
thanks