diff --git a/de-DE/code/starter/main.py b/de-DE/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/de-DE/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/de-DE/code/starter/project_config.yml b/de-DE/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/de-DE/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/de-DE/images/banner.png b/de-DE/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/de-DE/images/banner.png differ diff --git a/de-DE/meta.yml b/de-DE/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/de-DE/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/de-DE/resources/mentor.md b/de-DE/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/de-DE/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/de-DE/solutions/main.py b/de-DE/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/de-DE/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/de-DE/step_1.md b/de-DE/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/de-DE/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/de-DE/step_2.md b/de-DE/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/de-DE/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/de-DE/step_3.md b/de-DE/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/de-DE/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/de-DE/step_4.md b/de-DE/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/de-DE/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/de-DE/step_5.md b/de-DE/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/de-DE/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/de-DE/step_6.md b/de-DE/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/de-DE/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/es-419/code/starter/main.py b/es-419/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/es-419/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/es-419/code/starter/project_config.yml b/es-419/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/es-419/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/es-419/images/banner.png b/es-419/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/es-419/images/banner.png differ diff --git a/es-419/meta.yml b/es-419/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/es-419/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/es-419/resources/mentor.md b/es-419/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/es-419/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/es-419/solutions/main.py b/es-419/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/es-419/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/es-419/step_1.md b/es-419/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/es-419/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/es-419/step_2.md b/es-419/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/es-419/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/es-419/step_3.md b/es-419/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/es-419/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/es-419/step_4.md b/es-419/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/es-419/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/es-419/step_5.md b/es-419/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/es-419/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/es-419/step_6.md b/es-419/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/es-419/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/fr-FR/code/starter/main.py b/fr-FR/code/starter/main.py new file mode 100644 index 0000000..46e2575 --- /dev/null +++ b/fr-FR/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingrédients +proteine = 'TOFU' +legume_1 = 'CAROTTE' +legume_2 = 'POIS' +glucides = 'RIZ' +accompagnement = 'ŒUFS CUITS DUR' +garniture = 'MENTHE' +emoji = '🍽️😋' + +# Impression de la recette finale +print(f'Commencez par une boule de {glucide}',f'Garnissez de dés de {legume_1} et de {legume_2}',f'Ajoutez des {proteine} grillées',f'Décorez avec {garniture}',f'Servez avec un accompagnement de {accompagnement}') \ No newline at end of file diff --git a/fr-FR/code/starter/project_config.yml b/fr-FR/code/starter/project_config.yml new file mode 100644 index 0000000..4583d84 --- /dev/null +++ b/fr-FR/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Gâcheurs de recette" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/fr-FR/images/banner.png b/fr-FR/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/fr-FR/images/banner.png differ diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml new file mode 100644 index 0000000..91d9b29 --- /dev/null +++ b/fr-FR/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Gâcheurs de recette +hero_image: images/banner.png +description: Crée et sabote secrètement une recette en utilisant les méthodes de formatage d'impression et de manipulation de chaînes de caractères Python. +meta_title: Projets de programmation Python pour enfants et adolescent·e·s | Gâcheurs de recette +meta_description: Apprends Python avec la Raspberry Pi Foundation. Crée et sabote secrètement une recette en utilisant print(), les f-strings, les emojis et .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/fr-FR/resources/mentor.md b/fr-FR/resources/mentor.md new file mode 100644 index 0000000..a7bf9f0 --- /dev/null +++ b/fr-FR/resources/mentor.md @@ -0,0 +1,47 @@ +# Notes du mentor·e : Gâcheurs de recette + +## Aperçu + +Cette leçon s'appuie sur les bases de `print()` et des f-strings en introduisant : + +- Imprimer le formatage en utilisant `sep=` et `end=` +- Méthodes de casse (`.lower()`) +- Techniques de farce avec `.replace()` +- Amélioration visuelle avec les emojis + +Les apprenant·e·s prennent une recette existante et la transforment progressivement en quelque chose de plus facile à lire, puis la sabotent secrètement pour s'amuser. + +--- + +## Ce qu'ils vont apprendre + +- Comment scinder les longues lignes de code pour une meilleure lisibilité +- Comment utiliser `sep='\n'` pour ajouter des sauts de ligne +- Comment insérer des emojis sous forme de puces +- Comment utiliser `.lower()` pour la mise en forme +- Comment utiliser `.replace()` pour des farces créatives + +--- + +## Conseils + +- Encouragez l'expérimentation avec les emojis +- Les apprenant·e·s doivent exécuter le code avant et après chaque étape pour en comprendre l'impact +- Il est important de préciser que `.replace()` ne modifie pas la chaîne d'origine ; elle en renvoie une nouvelle + +--- + +## Défis + +- Assurez un placement correct de `sep=`, en particulier lorsque vous utilisez des emojis + une nouvelle ligne +- Utilisez `.replace()` de manière sûre sans altérer les chaînes de caractères +- Gérez de manière cohérente les noms de variables entre les tâches + +--- + +## Idées d'extension + +- Demandez aux apprenant·e·s d'écrire leur propre recette et de la saboter +- Introduisez `.count()` ou `.find()` pour inspecter le contenu de la chaîne de caractères +- Créez un menu de farce à deux options utilisant des conditions (si vous êtes prêt) + diff --git a/fr-FR/solutions/main.py b/fr-FR/solutions/main.py new file mode 100644 index 0000000..ffe8c51 --- /dev/null +++ b/fr-FR/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +proteine = 'TOFU'.replace('FU', 'RTUE') # ➝ TORTUE +legume_1 = 'CAROTTE'.replace('CAR', 'B') # ➝ BOTTE +glucide = 'RIZ'.replace('RIZ, 'AT') # ➝ RAT +legume_2 = 'POIS' +garniture = 'MENTHE' +accompagnement = 'ŒUFS CUITS DUR' + +print( + f'{emoji} Commencez par une dose de {glucide.lower()}', + f'Recouvrez par des dés de {legume_1.lower()} et {legume_2.lower()}', + f'Ajoutez des {protéine.title()} grillées', + f'Garnissez avec {garniture.lower()}', + f'Servez avec un accompagnement de {accompagnement.lower()}', + sep='\n' +) diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md new file mode 100644 index 0000000..804a83d --- /dev/null +++ b/fr-FR/step_1.md @@ -0,0 +1,50 @@ +

Faciliter la lecture du code

+ +\--- task --- + +Divise la longue instruction d'impression en plusieurs lignes pour la rendre plus facile à comprendre. + +\--- /task --- + +

Un code lisible est un bon code

+ +Le gérant d'un café a écrit toutes les parties imprimables de la recette sur une seule longue ligne — ça fonctionne, mais c'est difficile à lire ! + +Heureusement, Python te permet d'écrire de longues instructions `print()` sur plusieurs lignes. +Il te suffit de **terminer chaque partie avec une virgule**, et Python la traitera toujours comme une seule commande. + +--- + +**Exécute le programme une fois** avant de faire des changements et regarde la sortie. +Ensuite, divise l'instruction d'impression sur plusieurs lignes et exécute-la à nouveau. +Le résultat devrait être le même, mais le code est beaucoup plus facile à lire ! + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 11 +line_highlights: +--- + +print( +f'Commencez par une dose de {glucide}', +f'Recouvrez de dés de {legume_1} et de {legume_2}', +f'Ajoutez des {proteine} grillées', +f'Garnisez avec {garniture}', +f'Servez avec un accompagnement de {accompagnement}' +) + +\--- /code --- + +
+ +
+ +### Astuce + +Assure-toi de laisser **des virgules** à la fin de chaque ligne dans la déclaration d'impression ! + +
diff --git a/fr-FR/step_2.md b/fr-FR/step_2.md new file mode 100644 index 0000000..b15354c --- /dev/null +++ b/fr-FR/step_2.md @@ -0,0 +1,50 @@ +

Corriger le format de sortie

+ +\--- task --- + +Utilise `sep='\n'` pour imprimer chaque partie de la recette sur sa propre ligne. + +\--- /task --- + +

Diviser la sortie en lignes

+ +Pour l'instant, toutes les lignes des recettes semblent compressées les unes contre les autres. +Tu peux utiliser l'option `sep=` dans `print()` pour dire à Python ce qu'il faut mettre **entre** chaque élément. + +En définissant \`sep='\n', tu obtiendras une **nouvelle ligne** entre chaque partie de l'impression. + +Voici à quoi ton code devrait ressembler : + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 11 +line_highlights: 17 +--- + +print( +f'Commencez par une dose de {glucide}', +f'Recouvrez de dés de {legume_1} et de {legume_2}', +f'Ajoutez des {proteine} grillées', +f'Garnisez avec {garniture}', +f'Servez avec un accompagnement de {accompagnement}'), +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Débogage + +Si ta recette tient toujours sur une seule ligne, vérifie : + +- As-tu ajouté `sep='\n'` à la fin du `print()` ? +- Les virgules sont-elles bien placées après chaque ligne ? + +
diff --git a/fr-FR/step_3.md b/fr-FR/step_3.md new file mode 100644 index 0000000..ba255ff --- /dev/null +++ b/fr-FR/step_3.md @@ -0,0 +1,49 @@ +

Ajouter des puces emoji

+ +\--- task --- + +Utilise la variable emoji pour ajouter une puce à chaque ligne. + +\--- /task --- + +

Embellir ta liste

+ +Maintenant que les lignes sont séparées, ajoutons quelques puces ! + +Tu peux le faire en changeant à nouveau le séparateur, cette fois en `sep='\n' + emoji`. + +De plus, tu devras ajouter manuellement l'emoji au **début de la première ligne**, car `sep` ne l'ajoute qu'_entre_ les lignes. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 11 +line_highlights: 12, 17 +--- + +print( +f'{emoji}Commencez par une dose de {glucide}', +f'Recouvrez de dés de {legume_1} et de {legume_2}', +f'Ajoutez des {proteine} grillées', +f'Garnisez avec {garniture}', +f'Servez avec un accompagnement de {accompagnement}'), +sep='\n + emoji' +) + +\--- /code --- + +
+ +
+ +### Astuce + +Essaie de changer la variable `emoji` en haut par quelque chose de mignon comme :
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/fr-FR/step_4.md b/fr-FR/step_4.md new file mode 100644 index 0000000..857689c --- /dev/null +++ b/fr-FR/step_4.md @@ -0,0 +1,40 @@ +

Corriger le formatage des ingrédients

+ +\--- task --- + +Utilise `.title()` et `.lower()` sur les valeurs des ingrédients à l'intérieur de la ligne `print()`. + +\--- /task --- + +

Rendre les ingrédients lisibles

+ +Les ingrédients sont écrits tout en majuscules — rendons-les plus lisibles dans la recette finale. + +- Utilise `.lower()` pour mettre toutes les lettres en minuscules + +Mets à jour chaque ligne `print()`. Deux lignes ont été faites pour toi ci-dessous. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Ajoutez des {proteine.lower()} grillées' +f'Garnisez avec {accompagnement.lower()}' + +\--- /code --- + +
+ +
+ +### Débogage + +Assure-toi que tes parenthèses et accolades correspondent correctement lorsque tu appelles `.lower()` à l'intérieur d'une chaîne. + +
diff --git a/fr-FR/step_5.md b/fr-FR/step_5.md new file mode 100644 index 0000000..b671b42 --- /dev/null +++ b/fr-FR/step_5.md @@ -0,0 +1,43 @@ +

Sabotage de la recette avec la fonction .replace()

+ +\--- task --- + +Utilise `.replace()` pour remplacer secrètement les ingrédients par des ingrédients dégoûtants ! + +\--- /task --- + +

Que la farce commence

+ +Maintenant que ta recette est magnifique… il est temps de tout gâcher 😂 + +Utilise `.replace()` pour modifier discrètement les valeurs de tes variables **en haut** de ton code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +proteine = 'TOFU'.replace('FU', 'RTUE') # ➝ TORTUE +veg_1 = 'CAROTTE'.replace('CAR', 'B') # ➝ BOTTE + +\--- /code --- + +
+ +
+ +### Astuce + +Voici plus d'idées : + +- POIS ➝ PUCES +- RIZ ➝ RAT +- ŒUFS CUIT DUR ➝ ŒUFS AVARIÉS +- MENTHE ➝ MENHIR + +
diff --git a/fr-FR/step_6.md b/fr-FR/step_6.md new file mode 100644 index 0000000..3f43f67 --- /dev/null +++ b/fr-FR/step_6.md @@ -0,0 +1,60 @@ +

Remplacer les emojis pour le fun (ou l'horreur)

+ +\--- task --- + +Utilise `.replace()` sur la variable emoji pour transformer des puces mignonnes en puces effrayantes. + +\--- /task --- + +

Changer d'ambiance avec des emojis

+ +Tes puces emojis ont l'air appétissantes — mais changeons cela ! + +Utilise `.replace()` sur la variable `emoji` pour transformer les symboles joyeux en quelque chose d'horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Ou remplace tout le contenu : + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Astuce + +Autres emojis à essayer :
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/hi-IN/code/starter/main.py b/hi-IN/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/hi-IN/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/hi-IN/code/starter/project_config.yml b/hi-IN/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/hi-IN/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/hi-IN/images/banner.png b/hi-IN/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/hi-IN/images/banner.png differ diff --git a/hi-IN/meta.yml b/hi-IN/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/hi-IN/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/hi-IN/resources/mentor.md b/hi-IN/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/hi-IN/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/hi-IN/solutions/main.py b/hi-IN/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/hi-IN/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/hi-IN/step_1.md b/hi-IN/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/hi-IN/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/hi-IN/step_2.md b/hi-IN/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/hi-IN/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/hi-IN/step_3.md b/hi-IN/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/hi-IN/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/hi-IN/step_4.md b/hi-IN/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/hi-IN/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/hi-IN/step_5.md b/hi-IN/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/hi-IN/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/hi-IN/step_6.md b/hi-IN/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/hi-IN/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/it-IT/code/starter/main.py b/it-IT/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/it-IT/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/it-IT/code/starter/project_config.yml b/it-IT/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/it-IT/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/it-IT/images/banner.png b/it-IT/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/it-IT/images/banner.png differ diff --git a/it-IT/meta.yml b/it-IT/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/it-IT/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/it-IT/resources/mentor.md b/it-IT/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/it-IT/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/it-IT/solutions/main.py b/it-IT/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/it-IT/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/it-IT/step_1.md b/it-IT/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/it-IT/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/it-IT/step_2.md b/it-IT/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/it-IT/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/it-IT/step_3.md b/it-IT/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/it-IT/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/it-IT/step_4.md b/it-IT/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/it-IT/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/it-IT/step_5.md b/it-IT/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/it-IT/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/it-IT/step_6.md b/it-IT/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/it-IT/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/ja-JP/code/starter/main.py b/ja-JP/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/ja-JP/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/ja-JP/code/starter/project_config.yml b/ja-JP/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/ja-JP/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/ja-JP/images/banner.png b/ja-JP/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/ja-JP/images/banner.png differ diff --git a/ja-JP/meta.yml b/ja-JP/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/ja-JP/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/ja-JP/resources/mentor.md b/ja-JP/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/ja-JP/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/ja-JP/solutions/main.py b/ja-JP/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/ja-JP/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/ja-JP/step_1.md b/ja-JP/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/ja-JP/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/ja-JP/step_2.md b/ja-JP/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/ja-JP/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/ja-JP/step_3.md b/ja-JP/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/ja-JP/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/ja-JP/step_4.md b/ja-JP/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/ja-JP/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/ja-JP/step_5.md b/ja-JP/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/ja-JP/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/ja-JP/step_6.md b/ja-JP/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/ja-JP/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/nl-NL/code/starter/main.py b/nl-NL/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/nl-NL/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/nl-NL/code/starter/project_config.yml b/nl-NL/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/nl-NL/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/nl-NL/images/banner.png b/nl-NL/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/nl-NL/images/banner.png differ diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/nl-NL/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/nl-NL/resources/mentor.md b/nl-NL/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/nl-NL/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/nl-NL/solutions/main.py b/nl-NL/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/nl-NL/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/nl-NL/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/nl-NL/step_2.md b/nl-NL/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/nl-NL/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/nl-NL/step_3.md b/nl-NL/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/nl-NL/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/nl-NL/step_4.md b/nl-NL/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/nl-NL/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/nl-NL/step_5.md b/nl-NL/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/nl-NL/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/nl-NL/step_6.md b/nl-NL/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/nl-NL/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/pt-BR/code/starter/main.py b/pt-BR/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/pt-BR/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/pt-BR/code/starter/project_config.yml b/pt-BR/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/pt-BR/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/pt-BR/images/banner.png b/pt-BR/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/pt-BR/images/banner.png differ diff --git a/pt-BR/meta.yml b/pt-BR/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/pt-BR/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/pt-BR/resources/mentor.md b/pt-BR/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/pt-BR/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/pt-BR/solutions/main.py b/pt-BR/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/pt-BR/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/pt-BR/step_1.md b/pt-BR/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/pt-BR/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/pt-BR/step_2.md b/pt-BR/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/pt-BR/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/pt-BR/step_3.md b/pt-BR/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/pt-BR/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/pt-BR/step_4.md b/pt-BR/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/pt-BR/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/pt-BR/step_5.md b/pt-BR/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/pt-BR/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/pt-BR/step_6.md b/pt-BR/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/pt-BR/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file diff --git a/uk-UA/code/starter/main.py b/uk-UA/code/starter/main.py new file mode 100644 index 0000000..a68ddac --- /dev/null +++ b/uk-UA/code/starter/main.py @@ -0,0 +1,11 @@ +# Ingredients +protein = 'TOFU' +veg_1 = 'CARROT' +veg_2 = 'PEAS' +carb = 'RICE' +side = 'BOILED EGGS' +garnish = 'MINT' +emoji = '🍽️😋' + +# Final recipe print +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}') \ No newline at end of file diff --git a/uk-UA/code/starter/project_config.yml b/uk-UA/code/starter/project_config.yml new file mode 100644 index 0000000..3d8d40c --- /dev/null +++ b/uk-UA/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python bytes - Recipe wreckers" +identifier: "python-bytes-recipe-wreckers" +type: 'python' +build: true diff --git a/uk-UA/images/banner.png b/uk-UA/images/banner.png new file mode 100644 index 0000000..454465b Binary files /dev/null and b/uk-UA/images/banner.png differ diff --git a/uk-UA/meta.yml b/uk-UA/meta.yml new file mode 100644 index 0000000..912eb26 --- /dev/null +++ b/uk-UA/meta.yml @@ -0,0 +1,21 @@ +title: Python bytes - Recipe wreckers +hero_image: images/banner.png +description: Create and secretly sabotage a recipe using Python print formatting and string methods. +meta_title: Python coding projects for kids and teens | Recipe Wreckers +meta_description: Learn Python with the Raspberry Pi Foundation. Make and secretly ruin a recipe using print(), f-strings, emoji, and .replace(). +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-04" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + - title: step_6 + completion: + - internal + - external diff --git a/uk-UA/resources/mentor.md b/uk-UA/resources/mentor.md new file mode 100644 index 0000000..b5d1f85 --- /dev/null +++ b/uk-UA/resources/mentor.md @@ -0,0 +1,47 @@ +# Mentor Notes: Recipe Wreckers + +## Overview + +This lesson builds on the basics of `print()` and f-strings by introducing: + +- Print formatting using `sep=` and `end=` +- String case methods (`.lower()`) +- Pranking techniques with `.replace()` +- Visual enhancement with emoji + +Learners take an existing recipe and gradually transform it into something easier to read, then secretly sabotage it for fun. + +--- + +## What They Will Learn + +- How to split long lines of code for readability +- How to use `sep='\n'` to add line breaks +- How to insert emoji as bullet points +- How to use `.lower()` for styling +- How to use `.replace()` for creative pranks + +--- + +## Tips + +- Encourage experimentation with emoji +- Learners should run code before and after each step to understand the impact +- Reinforce that `.replace()` doesn’t change the original string — it returns a new one + +--- + +## Challenges + +- Ensuring correct placement of `sep=`, especially when using emoji + newline +- Using `.replace()` safely without breaking strings +- Managing variable names consistently between tasks + +--- + +## Extension Ideas + +- Ask learners to write their own recipe and sabotage it +- Introduce `.count()` or `.find()` to inspect string contents +- Create a two-option prank menu using conditionals (if ready) + diff --git a/uk-UA/solutions/main.py b/uk-UA/solutions/main.py new file mode 100644 index 0000000..304a1f6 --- /dev/null +++ b/uk-UA/solutions/main.py @@ -0,0 +1,17 @@ +emoji = '🍽️😋'.replace('😋', '🤢') + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT +carb = 'RICE'.replace('R', 'L') # ➝ LICE +veg_2 = 'PEAS' +garnish = 'MINT' +side = 'BOILED EGGS' + +print( + f'{emoji} Start with a scoop of {carb.lower()}', + f'Top with diced {veg_1.lower()} and {veg_2.lower()}', + f'Add grilled {protein.title()}', + f'Garnish with {garnish.lower()}', + f'Serve with a side of {side.lower()}', + sep='\n' +) diff --git a/uk-UA/step_1.md b/uk-UA/step_1.md new file mode 100644 index 0000000..e94d874 --- /dev/null +++ b/uk-UA/step_1.md @@ -0,0 +1,50 @@ +

Make the code easier to read

+ +\--- task --- + +Split the long print statement onto multiple lines so it’s easier to understand. + +\--- /task --- + +

Readable code is good code

+ +A café manager has written all the recipe print parts on one long line — it works, but it's hard to read! + +Luckily, Python lets you write long `print()` statements across multiple lines. +You just need to **end each part with a comma**, and Python will still treat it as one command. + +--- + +**Run the program once** before making changes and look at the output. +Then split the print statement across multiple lines and run it again. +The output should be the same — but the code is much easier to read! + +
+--- code --- +--- +language: python +filename: main.py +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 --- + +
+ +
+ +### Tip + +Make sure you leave **commas** at the end of each line inside the print statement! + +
diff --git a/uk-UA/step_2.md b/uk-UA/step_2.md new file mode 100644 index 0000000..4f7bf91 --- /dev/null +++ b/uk-UA/step_2.md @@ -0,0 +1,50 @@ +

Fix the output format

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

Split the output into lines

+ +Right now, all the recipe lines appear squashed together. +You can use the `sep=` option in `print()` to tell Python what to put **between** each item. + +By setting `sep='\n'`, you’ll get a **new line** between every part of the print. + +Here’s what your code should look like: + +
+--- code --- +--- +language: python +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' +) + +\--- /code --- + +
+ +
+ +### Debugging + +If your recipe is still on one line, check: + +- Did you add `sep='\n'` at the end of the `print()`? +- Are the commas in place after each line? + +
diff --git a/uk-UA/step_3.md b/uk-UA/step_3.md new file mode 100644 index 0000000..5c9d299 --- /dev/null +++ b/uk-UA/step_3.md @@ -0,0 +1,49 @@ +

Add emoji bullets

+ +\--- task --- + +Use the emoji variable to add a bullet point to every line. + +\--- /task --- + +

Make your list look amazing

+ +Now that the lines are separated, let’s add some bullet points! + +You can do this by changing the separator again, this time to `sep='\n' + emoji`. + +Also, you’ll want to manually add the emoji at the **start of the first line**, since `sep` only adds it _between_ lines. + +
+--- code --- +--- +language: python +filename: main.py +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}', +f'Add grilled {protein}', +f'Garnish with {garnish}', +f'Serve with a side of {side}', +sep='\n' + emoji +) + +\--- /code --- + +
+ +
+ +### Tip + +Try changing the `emoji` variable at the top to something cute like:
+• 🍽️😋
+• 🧁
+• 🍱 + +
diff --git a/uk-UA/step_4.md b/uk-UA/step_4.md new file mode 100644 index 0000000..616168b --- /dev/null +++ b/uk-UA/step_4.md @@ -0,0 +1,40 @@ +

Fix the ingredient formatting

+ +\--- task --- + +Use `.title()` and `.lower()` on the ingredient values inside the `print()` line. + +\--- /task --- + +

Make the ingredients readable

+ +The ingredients are written in all uppercase — let’s make them easier to read in the final recipe. + +- Use `.lower()` to make all the letters lowercase + +Update each of the `print()` lines. Two lines have been done for you below. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 14 +line_highlights: +--- + +f'Add grilled {protein.lower()}' +f'Garnish with {garnish.lower()}' + +\--- /code --- + +
+ +
+ +### Debugging + +Make sure your parentheses and curly braces match correctly when calling `.lower()` inside a string. + +
diff --git a/uk-UA/step_5.md b/uk-UA/step_5.md new file mode 100644 index 0000000..dc10299 --- /dev/null +++ b/uk-UA/step_5.md @@ -0,0 +1,43 @@ +

Sabotage the recipe with .replace()

+ +\--- task --- + +Use `.replace()` to secretly swap ingredients with disgusting ones! + +\--- /task --- + +

Let the prank begin

+ +Now that your recipe looks beautiful… it’s time to ruin it 😂 + +Use `.replace()` to quietly change the values of your variables **at the top** of your code. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 2 +line_highlights: +--- + +protein = 'TOFU'.replace('FU', 'AD') # ➝ TOAD +veg_1 = 'CARROT'.replace('CAR', '') # ➝ ROT + +\--- /code --- + +
+ +
+ +### Tip + +Here are more ideas: + +- PEAS ➝ FLEAS +- RICE ➝ LICE +- BOILED EGGS ➝ SPOILED EGGS +- MINT ➝ PAINT + +
diff --git a/uk-UA/step_6.md b/uk-UA/step_6.md new file mode 100644 index 0000000..6ccaf1f --- /dev/null +++ b/uk-UA/step_6.md @@ -0,0 +1,60 @@ +

Replace the emoji for fun (or horror)

+ +\--- task --- + +Use `.replace()` on the emoji variable to turn cute bullets into creepy ones. + +\--- /task --- + +

Change the mood with emoji

+ +Your emoji bullets look tasty — but let’s change that! + +Use `.replace()` on the `emoji` variable to turn happy symbols into something horrible. + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🍽️😋'.replace('😋', '🤢') # ➝ 🍽️🤢 + +\--- /code --- + +
+ +Or replace the whole thing completely: + +
+--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 8 +line_highlights: +--- + +emoji = '🪳💀' + +\--- /code --- + +
+ +
+ +### Tip + +Other emoji options to try:
+• 🦗
+• 💩
+• 🧟
+• ☠️
+• 🐛 + +
\ No newline at end of file