Question: get_last_to_first: (dict[str, list[str]]) -> dict[str, list[str]] The parameter represents a person to friends dictionary. This function must return a last name to first names dictionary
The parameter represents a "person to friends" dictionary. This function must return a "last name to first names" dictionary built from the data in the given dictionary. The keys in the returned dictionary should be the last names of people in the given dictionary. (Remember: every person has exactly one last name.) The values are lists of the first names (sorted in alphabetical order) of people with a given last name. The returned dictionary should contain every person whose name appears in the given dictionary: the person's last name as one of the dictionary keys, and the person's first name as an element in one of the dictionary values. Names in the list should be unique: no one should be listed more than once. Use method list.sort to put the lists of first names into alphabetical order.get_last_to_first: (dict[str, list[str]]) -> dict[str, list[str]] ![get_last_to_first: (dict[str, list[str]]) -> dict[str, list[str]]The parameter represents a "person to friends"](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/670f813a9233e_370670f813a7070c.jpg)

\f\f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
