(Python3)
Write a function friend_besties() that calculates the \"besties\"(i.e. degree-one friends) of a given individual in a socialnetwork. The function takes two arguments:
- individual, an individual in the social network, in the form ofa string ID.
- bestie_dict, a dictionary of sets of friends of each individualin the social network (as per the first question of theProject)
The function should return a sorted list, made up of all\"degree-one\" friends for the individual. In the instance that theindividual does not have any friends in the social network, thefunction should return an empty list.
Example:
>>> friend_besties('kim', {'kim': {'sandy', 'alex','glenn'}, 'sandy': {'kim', 'alex'}, 'alex': {'kim', 'sandy'},'glenn': {'kim'}})
['alex', 'glenn', 'sandy']
>>> friend_besties('ali', {'kim': {'sandy', 'alex','glenn'}, 'sandy': {'kim', 'alex'}, 'alex': {'kim', 'sandy'},'glenn': {'kim'}})
[]