im fcked, csc108 assignment3 def get_last_to_first( person_to_friends: Dict[str, List[str]]) -> Dict[str, List[str]]:
View the step-by-step solution to:


im fcked, csc108 assignment3

def get_last_to_first(

    person_to_friends: Dict[str,

List[str]]) -> Dict[str, List[str]]:

  """Return a "last name to first name(s)" dictionary with the people from the

  "person to friends" dictionary person_to_friends.

  >>> get_last_to_first(P2F) == {

  ...  'Katsopolis': ['Jesse'],

  ...  'Tanner': ['Danny R', 'Michelle', 'Stephanie J'],

  ...  'Gladstone': ['Joey'],

  ...  'Donaldson-Katsopolis': ['Rebecca'],

  ...  'Gibbler': ['Kimmy'],

  ...  'Tanner-Fuller': ['DJ']}



  pass # Remove me when you've implemented this function

def invert_and_sort(key_to_value: Dict[object, object]) -> Dict[object, list]:

  """Return key_to_value inverted so that each key is a value (for

  non-list values) or an item from an iterable value, and each value

  is a list of the corresponding keys from key_to_value. The value

  lists in the returned dict are sorted.

  >>> invert_and_sort(P2C) == {

  ... 'Comet Club': ['Michelle Tanner'],

  ... 'Parent Council': ['Danny R Tanner', 'Jesse Katsopolis',

  ...           'Joey Gladstone'],

  ... 'Rock N Rollers': ['Jesse Katsopolis', 'Kimmy Gibbler'],

  ... 'Comics R Us': ['Joey Gladstone'],

  ... 'Stamp Club': ['Kimmy Gibbler']}



  pass # Remove me when you've implemented this function

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes