Skip to content

Commit 2ebcfe8

Browse files
authored
[Mecha Munch Management] Fixed typos in Instructions, Introduction, & Stub File (#3937)
* Fixed typos in instructions, introduction, and stub file. * Changed stub docstring to iterable from dict.
1 parent 3da0c16 commit 2ebcfe8

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

exercises/concept/mecha-munch-management/.docs/instructions.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,28 @@ Create the function `update_recipes(<ideas>, <recipe_updates>)` that takes an "i
5757
The function should return the new/updated "ideas" dictionary.
5858

5959
```python
60-
>>> update_recipes({'Banana Bread' : {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
61-
'Raspberry Pie' : {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1}},
62-
(('Banana Bread', {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Butter': 1, 'Milk': 2, 'Eggs': 3}),))
60+
>>>update_recipes(
61+
{'Banana Bread' : {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
62+
'Raspberry Pie' : {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1}},
63+
(('Banana Bread', {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Butter': 1, 'Milk': 2, 'Eggs': 3}),)
64+
)
6365
...
6466

65-
{'Banana Bread' : {'Banana': 4, 'Apple': 1, 'Walnuts': 2, 'Flour': 1, 'Butter': 1, 'Milk': 2, 'Eggs': 3},
66-
'Raspberry Pie' : {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1}}
67-
68-
>>> update_recipes({'Banana Bread' : {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
69-
'Raspberry Pie' : {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1},
70-
'Pasta Primavera': {'Eggs': 1, 'Carrots': 1, 'Spinach': 2, 'Tomatoes': 3, 'Parmesan': 2, 'Milk': 1, 'Onion': 1}},
71-
[('Raspberry Pie', {'Raspberry': 3, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1, 'Whipped Cream': 2}),
72-
('Pasta Primavera', {'Eggs': 1, 'Mixed Veggies': 2, 'Parmesan': 2, 'Milk': 1, 'Spinach': 1, 'Bread Crumbs': 1}),
73-
('Blueberry Crumble', {'Blueberries': 2, 'Whipped Creme': 2, 'Granola Topping': 2, 'Yogurt': 3})])
67+
{'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Butter': 1, 'Milk': 2, 'Eggs': 3},
68+
'Raspberry Pie': {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1}}
69+
70+
>>> update_recipes(
71+
{'Banana Bread' : {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
72+
'Raspberry Pie' : {'Raspberry': 1, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1},
73+
'Pasta Primavera': {'Eggs': 1, 'Carrots': 1, 'Spinach': 2, 'Tomatoes': 3, 'Parmesan': 2, 'Milk': 1, 'Onion': 1}},
74+
[('Raspberry Pie', {'Raspberry': 3, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1, 'Whipped Cream': 2}),
75+
('Pasta Primavera', {'Eggs': 1, 'Mixed Veggies': 2, 'Parmesan': 2, 'Milk': 1, 'Spinach': 1, 'Bread Crumbs': 1}),
76+
('Blueberry Crumble', {'Blueberries': 2, 'Whipped Creme': 2, 'Granola Topping': 2, 'Yogurt': 3})]
77+
)
7478
...
7579

76-
{'Banana Bread': {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
77-
'Raspberry Pie': {'Raspberry': 3, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1, 'Whipped Cream': 2},
80+
{'Banana Bread': {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1},
81+
'Raspberry Pie': {'Raspberry': 3, 'Orange': 1, 'Pie Crust': 1, 'Cream Custard': 1, 'Whipped Cream': 2},
7882
'Pasta Primavera': {'Eggs': 1, 'Mixed Veggies': 2, 'Parmesan': 2, 'Milk': 1, 'Spinach': 1, 'Bread Crumbs': 1},
7983
'Blueberry Crumble': {'Blueberries': 2, 'Whipped Creme': 2, 'Granola Topping': 2, 'Yogurt': 3}}
8084
```

exercises/concept/mecha-munch-management/.docs/introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ This allows keys, values, or (`key`, `value`) pairs to be iterated over in Last-
8787
```python
8888
>>> palette_II = {'Factory Stone Purple': '#7c677f', 'Green Treeline': '#478559', 'Purple baseline': '#161748'}
8989

90-
# Iterating in insertion order
90+
# Iterating in insertion order (First in, first out)
9191
>>> for item in palette_II.items():
9292
... print(item)
9393
...
@@ -96,7 +96,7 @@ This allows keys, values, or (`key`, `value`) pairs to be iterated over in Last-
9696
('Purple baseline', '#161748')
9797

9898

99-
# Iterating in the reverse direction.
99+
# Iterating in the reverse direction. (Last in, first out)
100100
>>> for item in reversed(palette_II.items()):
101101
... print (item)
102102
...
@@ -108,12 +108,12 @@ This allows keys, values, or (`key`, `value`) pairs to be iterated over in Last-
108108
## Sorting a Dictionary
109109

110110
Dictionaries do not have a built-in sorting method.
111-
However, it is possible to sort a `dict` _view_ using the built-in function `sorted()` with `.items()`.
111+
However, it is possible to sort a `dict` _view_ using the built-in function `sorted()` with `dict.items()`.
112112
The sorted view can then be used to create a new dictionary.
113-
Like iteration, the default sort is over dictionary `keys`.
113+
Like iteration, the default sort is over the dictionary `keys`.
114114

115115
```python
116-
# Default ordering for a dictionary is last in, first out (LIFO).
116+
# Default ordering for a dictionary is insertion order (First in, first out).
117117
>>> color_palette = {'Grassy Green': '#9bc400',
118118
'Purple Mountains Majesty': '#8076a3',
119119
'Misty Mountain Pink': '#f9c5bd',

exercises/concept/mecha-munch-management/dict_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def update_recipes(ideas, recipe_updates):
2626
"""Update the recipe ideas dictionary.
2727
2828
:param ideas: dict - The "recipe ideas" dict.
29-
:param recipe_updates: dict - dictionary with updates for the ideas section.
29+
:param recipe_updates: iterable - with updates for the ideas section.
3030
:return: dict - updated "recipe ideas" dict.
3131
"""
3232

0 commit comments

Comments
 (0)