please check pdf and provide the code answer with explaination
- List all the presidents whose names contain the letter ‘a’
- List all the presidents whose names do not contain the letter ‘m’
- For each president, list the number of times the letter ‘a’ appears
- create the list of the words in the Emma novel. Think of using the split method of string (please refer to last week Notebook if you do not know how to use split) because words are separated with a space. For example, the following text has three words because they are separated by two spaces “I am healthy”. Please, keep it is simple, and do not worry about the punctuation
- create the list of unique words using set
- for each word in the set, count the number of occurences by using a loop or any other method wish. At the end, you should have a list containing the list of occurences for all the words in the set
- finally, convert the set of unique words to a list, and create the dictionary with the two lists of unique words and frequencies
Using the while loop:
- List all the presidents whose names contain the letter ‘o’
- List all the presidents whose names do not contain the letter ‘w’
- For each president, list the number of times the letter ‘o’ appears