- In
get_friends_favorite_candy_count()
, return a dictionary of candy names and the amount of times each candy appears in thefriend_favorites
list.
friend_favorites = [
["Sally", ["lollipop", "bubble gum", "laffy taffy" ]],
["Bob", ["milky way", "licorice", "lollipop" ]],
["Arlene", ["chocolate bar", "milky way", "laffy taffy" ]],
["Carlie", ["nerds", "sour patch kids", "laffy taffy" ]]
]
- Given the list
friend_favorites
, create a new data structure in the functioncreate_new_candy_data_structure
that describes the different kinds of candy paired with a list of friends that like that candy.
friend_favorites = [
["Sally", ["lollipop", "bubble gum", "laffy taffy" ]],
["Bob", ["milky way", "licorice", "lollipop" ]],
["Arlene", ["chocolate bar", "milky way", "laffy taffy" ]],
["Carlie", ["nerds", "sour patch kids", "laffy taffy" ]]
]
-
In
get_friends_who_like_specified_candy()
, return a tuple of friends who like the candy specified in the candy_name parameter. -
In,
create_candy_set()
, return a set of all the candies from the data structure made increate_new_candy_data_structure()
. -
Starting with nominal cases, write tests for each of the functions in the file tests/test_candy_data_structure.py then write tests to handle edge cases.