Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions en/step_1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h2 class="c-project-heading--task">Make the code easier to read</h2>

--- task ---

Split the long print statement onto multiple lines so it’s easier to understand.

--- /task ---

<h2 class="c-project-heading--explainer">Readable code is good code</h2>
Expand All @@ -25,14 +28,17 @@ line_numbers: true
line_number_start: 11
line_highlights:
---

print(
f'Start with a scoop of {carb}',
f'Top with diced {veg_1} and {veg_2}',
f'Add grilled {protein}',
f'Garnish with {garnish}',
f'Serve with a side of {side}'
)

--- /code ---

</div>

<div class="c-project-callout c-project-callout--tip">
Expand Down
7 changes: 6 additions & 1 deletion en/step_2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h2 class="c-project-heading--task">Fix the output format</h2>

--- task ---

Use `sep='\n'` to print each part of the recipe on its own line.

--- /task ---

<h2 class="c-project-heading--explainer">Split the output into lines</h2>
Expand All @@ -20,8 +23,8 @@ filename: main.py
line_numbers: true
line_number_start: 11
line_highlights: 17

---

print(
f'Start with a scoop of {carb}',
f'Top with diced {veg_1} and {veg_2}',
Expand All @@ -30,7 +33,9 @@ print(
f'Serve with a side of {side}',
sep='\n'
)

--- /code ---

</div>

<div class="c-project-callout c-project-callout--debug">
Expand Down
6 changes: 6 additions & 0 deletions en/step_3.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

<h2 class="c-project-heading--task">Add emoji bullets</h2>

--- task ---

Use the emoji variable to add a bullet point to every line.

--- /task ---

<h2 class="c-project-heading--explainer">Make your list look amazing</h2>
Expand All @@ -21,6 +24,7 @@ line_numbers: true
line_number_start: 11
line_highlights: 12, 17
---

print(
f'{emoji}Start with a scoop of {carb}',
f'Top with diced {veg_1} and {veg_2}',
Expand All @@ -29,7 +33,9 @@ print(
f'Serve with a side of {side}',
sep='\n' + emoji
)

--- /code ---

</div>

<div class="c-project-callout c-project-callout--tip">
Expand Down
6 changes: 6 additions & 0 deletions en/step_4.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h2 class="c-project-heading--task">Fix the ingredient formatting</h2>

--- task ---

Use `.title()` and `.lower()` on the ingredient values inside the `print()` line.

--- /task ---

<h2 class="c-project-heading--explainer">Make the ingredients readable</h2>
Expand All @@ -20,9 +23,12 @@ line_numbers: true
line_number_start: 14
line_highlights:
---

f'Add grilled {protein.lower()}'
f'Garnish with {garnish.lower()}'

--- /code ---

</div>

<div class="c-project-callout c-project-callout--debug">
Expand Down
6 changes: 6 additions & 0 deletions en/step_5.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h2 class="c-project-heading--task">Sabotage the recipe with .replace()</h2>

--- task ---

Use `.replace()` to secretly swap ingredients with disgusting ones!

--- /task ---

<h2 class="c-project-heading--explainer">Let the prank begin</h2>
Expand All @@ -18,9 +21,12 @@ line_numbers: true
line_number_start: 2
line_highlights:
---

protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD
veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT

--- /code ---

</div>

<div class="c-project-callout c-project-callout--tip">
Expand Down
9 changes: 9 additions & 0 deletions en/step_6.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h2 class="c-project-heading--task">Replace the emoji for fun (or horror)</h2>

--- task ---

Use `.replace()` on the emoji variable to turn cute bullets into creepy ones.

--- /task ---

<h2 class="c-project-heading--explainer">Change the mood with emoji</h2>
Expand All @@ -18,8 +21,11 @@ line_numbers: true
line_number_start: 8
line_highlights:
---

emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢

--- /code ---

</div>

Or replace the whole thing completely:
Expand All @@ -33,8 +39,11 @@ line_numbers: true
line_number_start: 8
line_highlights:
---

emoji = '🪳💀'

--- /code ---

</div>

<div class="c-project-callout c-project-callout--tip">
Expand Down