Question: Edef friend_list(friend_dictionary): ILILIT E Write a method named friendlist that accepts a dictionary as a parameter and reads friend relationships and stores them into a

Edef friend_list(friend_dictionary): ILILIT E Write a method named friendlist that accepts a dictionary as a parameter and reads friend relationships and stores them into a new dictionary that is returned. You should create a new dictionary where each key is a person's name from the original simple dictionary, and the value associated with that key is a list of all friends of that person. Friendships are bi-directional: if Marty is friends with Danielle, Danielle is friends with Marty. The dictionary parameter contains one friend relationship per key/value pair, consisting of two names. If the dictionary parameter, friendMap looks like this: Marty: Cynthia Danielle: Marty Then the call of friendList(friendMap) should return a dictionary with the following contents: {Cynthia:[Marty], Danielle: [Marty], Marty:[Cynthia, Danielle]} II II II pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
