Accept a sequence of words as input. The words come on a single line, separated by commas.
Create a dictionary named real_dict whose keys are the first letters of the words in the sequence. For each key (letter), the corresponding value should be the list of words that begin with that letter. For any given key, the words should be appended to the list in the order in which they appear in the sequence. A letter that does not begin any word in the sequence should not be a key of real_dict.
You can assume that all words of the sequence will be in lower case.
You do not have to print anything. The dictionary real_dict is checked for you.
Example
Input: apple,banana,avocado,cherry
real_dict: {'a': ['apple', 'avocado'], 'b': ['banana'], 'c': ['cherry']}
The input is read for you. Assign the answers to real_dict.
You do not need to print anything — the values you assign to those names are what gets checked, in that order.
Input
apple,banana,avocado,cherry,blueberry,apricot
Output
{'a': ['apple', 'avocado', 'apricot'], 'b': ['banana', 'blueberry'], 'c': ['cherry']}