44def add_item (current_cart , items_to_add ):
55 """Add items to shopping cart.
66
7- :param current_cart: dict - the current shopping cart.
8- :param items_to_add: iterable - items to add to the cart.
9- :return: dict - the updated user cart dictionary.
7+ Parameters:
8+ current_cart (dict): The current shopping cart.
9+ items_to_add (iterable): The items to add to the cart.
10+
11+ Returns:
12+ dict: The updated user cart dictionary.
1013 """
1114
1215 for item in items_to_add :
@@ -19,8 +22,11 @@ def add_item(current_cart, items_to_add):
1922def read_notes (notes ):
2023 """Create user cart from an iterable notes entry.
2124
22- :param notes: iterable of items to add to cart.
23- :return: dict - a user shopping cart dictionary.
25+ Parameters:
26+ notes (iterable): Group of items to add to cart.
27+
28+ Returns:
29+ dict: A user shopping cart dictionary.
2430 """
2531
2632 return dict .fromkeys (notes , 1 )
@@ -29,9 +35,12 @@ def read_notes(notes):
2935def update_recipes (ideas , recipe_updates ):
3036 """Update the recipe ideas dictionary.
3137
32- :param ideas: dict - The "recipe ideas" dict.
33- :param recipe_updates: dict - dictionary with updates for the ideas section.
34- :return: dict - updated "recipe ideas" dict.
38+ Parameters:
39+ ideas (dict): The "recipe ideas" dict.
40+ recipe_updates (iterable): Updates for the ideas section.
41+
42+ Returns:
43+ dict: The updated "recipe ideas" dict.
3544 """
3645
3746 ideas .update (recipe_updates )
@@ -41,20 +50,27 @@ def update_recipes(ideas, recipe_updates):
4150def sort_entries (cart ):
4251 """Sort a users shopping cart in alphabetically order.
4352
44- :param cart: dict - a users shopping cart dictionary.
45- :return: dict - users shopping cart sorted in alphabetical order.
46- """
53+ Parameters:
54+ cart (dict): A users shopping cart dictionary.
55+
56+ Returns:
57+ dict: A sers shopping cart sorted in alphabetical order.
58+ """
4759
4860 return dict (sorted (cart .items ()))
4961
5062
5163def send_to_store (cart , aisle_mapping ):
5264 """Combine users order to aisle and refrigeration information.
5365
54- :param cart: dict - users shopping cart dictionary.
55- :param aisle_mapping: dict - aisle and refrigeration information dictionary.
56- :return: dict - fulfillment dictionary ready to send to store.
66+ Parameters:
67+ cart (dict): The users shopping cart dictionary.
68+ aisle_mapping (dict): The aisle and refrigeration information dictionary.
69+
70+ Returns:
71+ dict: The fulfillment dictionary ready to send to store.
5772 """
73+
5874 fulfillment_cart = {}
5975
6076 for key in cart .keys ():
@@ -66,9 +82,12 @@ def send_to_store(cart, aisle_mapping):
6682def update_store_inventory (fulfillment_cart , store_inventory ):
6783 """Update store inventory levels with user order.
6884
69- :param fulfillment cart: dict - fulfillment cart to send to store.
70- :param store_inventory: dict - store available inventory
71- :return: dict - store_inventory updated.
85+ Parameters:
86+ fulfillment cart (dict): The fulfillment cart to send to store.
87+ store_inventory (dict): The stores available inventory.
88+
89+ Returns:
90+ dict: The store_inventory updated.
7291 """
7392
7493 for key , values in fulfillment_cart .items ():
0 commit comments