diff --git a/de-DE/code/starter/main.py b/de-DE/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/de-DE/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/de-DE/code/starter/project_config.yml b/de-DE/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/de-DE/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/de-DE/images/banner.png b/de-DE/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/de-DE/images/banner.png differ diff --git a/de-DE/mentor.md b/de-DE/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/de-DE/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/de-DE/meta.yml b/de-DE/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/de-DE/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/de-DE/resources/dataframe.json b/de-DE/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/de-DE/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "
50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/de-DE/solutions/main.py b/de-DE/solutions/main.py new file mode 100644 index 0000000..855cb24 --- /dev/null +++ b/de-DE/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!') diff --git a/de-DE/step_1.md b/de-DE/step_1.md new file mode 100644 index 0000000..ee16b36 --- /dev/null +++ b/de-DE/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Tip + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Debugging + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/de-DE/step_2.md b/de-DE/step_2.md new file mode 100644 index 0000000..349fedb --- /dev/null +++ b/de-DE/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Tip + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Debugging + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/de-DE/step_3.md b/de-DE/step_3.md new file mode 100644 index 0000000..23e2cc8 --- /dev/null +++ b/de-DE/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Tip + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Debugging + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/de-DE/step_4.md b/de-DE/step_4.md new file mode 100644 index 0000000..0a3a807 --- /dev/null +++ b/de-DE/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Tip + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Debugging + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/de-DE/step_5.md b/de-DE/step_5.md new file mode 100644 index 0000000..c0ad8a3 --- /dev/null +++ b/de-DE/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. Yum!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Tip + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Debugging + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### Feedback + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/es-419/code/starter/main.py b/es-419/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/es-419/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/es-419/code/starter/project_config.yml b/es-419/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/es-419/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/es-419/images/banner.png b/es-419/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/es-419/images/banner.png differ diff --git a/es-419/mentor.md b/es-419/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/es-419/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/es-419/meta.yml b/es-419/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/es-419/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/es-419/resources/dataframe.json b/es-419/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/es-419/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/es-419/solutions/main.py b/es-419/solutions/main.py new file mode 100644 index 0000000..855cb24 --- /dev/null +++ b/es-419/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!') diff --git a/es-419/step_1.md b/es-419/step_1.md new file mode 100644 index 0000000..129144c --- /dev/null +++ b/es-419/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Consejo + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Depuración + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/es-419/step_2.md b/es-419/step_2.md new file mode 100644 index 0000000..a1482b3 --- /dev/null +++ b/es-419/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Consejo + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Depuración + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/es-419/step_3.md b/es-419/step_3.md new file mode 100644 index 0000000..5814bbf --- /dev/null +++ b/es-419/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Consejo + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Depuración + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/es-419/step_4.md b/es-419/step_4.md new file mode 100644 index 0000000..ef27b71 --- /dev/null +++ b/es-419/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Consejo + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Depuración + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/es-419/step_5.md b/es-419/step_5.md new file mode 100644 index 0000000..1cbbd21 --- /dev/null +++ b/es-419/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. Yum!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Consejo + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Depuración + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### Comentarios + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/fr-FR/code/starter/main.py b/fr-FR/code/starter/main.py new file mode 100644 index 0000000..5c532db --- /dev/null +++ b/fr-FR/code/starter/main.py @@ -0,0 +1,12 @@ +# Fiche de recette Gross Groceries + +# Ingrédients et quantités pour 1 personne + + +# Nombre de portions + + +# Ingrédients en plus grande quantité + + +# Imprimer les instructions de la recette diff --git a/fr-FR/code/starter/project_config.yml b/fr-FR/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/fr-FR/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/fr-FR/images/banner.png b/fr-FR/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/fr-FR/images/banner.png differ diff --git a/fr-FR/mentor.md b/fr-FR/mentor.md new file mode 100644 index 0000000..7d95c88 --- /dev/null +++ b/fr-FR/mentor.md @@ -0,0 +1,30 @@ +# Informations pour le/la mentor·e : Gross Groceries + +## Aperçu du projet + +Dans ce projet, les apprenant·e·s utiliseront Python pour aider un restaurateur étrange à créer une fiche de recette dégoûtante. Ils commenceront par des ingrédients simples et progresseront jusqu'à imprimer des instructions de recette complètes en utilisant des f-strings. À la fin de cet apprentissage, les apprenant·e·s auront utilisé des variables, des chaînes de caractères, des nombres, des opérations arithmétiques simples et des f-strings à travers de multiples étapes. + +--- + +## Ce que les apprenant·e·s vont pratiquer + +- Créer et utiliser des variables +- Combiner des chaînes de caractères et des nombres avec des f-strings +- Effectuer une multiplication de base en code +- Écrire des programmes Python multi-lignes avec une structure claire + +--- + +## Conseils pédagogiques + +- Encouragez les apprenant·e·s à inventer leurs propres ingrédients dégoûtants. Plus c'est absurde, mieux c'est ! +- Incitez-les à lire attentivement les résultats imprimés afin de comprendre l'effet de leurs modifications. +- Soulignez que les f-strings sont un moyen puissant de combiner du texte et des valeurs sans avoir besoin de plusieurs symboles `+`. + +--- + +## Idées d'extension + +- Autorisez les apprenant·e·s à utiliser `input()` pour demander combien de personnes la recette est prévue +- Encouragez-les à utiliser `\n` pour formater les fiches de recettes multi-lignes +- Ajoutez encore plus d'ingrédients ou d'étapes à la recette diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml new file mode 100644 index 0000000..1476d06 --- /dev/null +++ b/fr-FR/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Crée une fiche de recette dégoûtante en utilisant des variables, des f-strings et des maths +meta_title: Apprendre à coder avec Gross Groceries | Python Bytes +meta_description: Apprends à utiliser les f-strings et les variables Python pour imprimer une recette dégoûtante pour un restaurant étrange. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/fr-FR/resources/dataframe.json b/fr-FR/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/fr-FR/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/fr-FR/solutions/main.py b/fr-FR/solutions/main.py new file mode 100644 index 0000000..8327593 --- /dev/null +++ b/fr-FR/solutions/main.py @@ -0,0 +1,27 @@ +# Fiche de recette Gross Groceries + +# Ingrédients et quantités pour 1 personne + +ingrédient_1 = 'purée d'asticots 🐛' +quantité_1 = 50 + +ingrédient_2 = 'jus de chaussette 🧦' +quantité_2 = 30 + +ingrédient_3 = 'miettes d'ongles de pied 🦶' +quantité_3 = 10 +# Nombre de portions +portions = 3 + +# Ingrédients en plus grande quantité +print(f'{quantité_1 * portions}g de {ingredient_1}') +print(f'{quantité_2 * portions}g de {ingredient_2}') +print(f'{quantité_3 * portions}g de {ingredient_3}') + +# Imprimer les instructions de la recette +print() +print(f'Pour préparer cette recette dégoûtante pour {servings} personnes, ajoutez {quantité_1 * portions} g de {ingredient_1} dans un grand bol.') +print() +print(f'Versez {quantité_2 * portions} ml de {ingredient_2}.') +print() +print(f'Saupoudrez de {quantité_3 * portions} g de {ingredient_3} et servez froid 🧊. Miam !') diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md new file mode 100644 index 0000000..199d7e2 --- /dev/null +++ b/fr-FR/step_1.md @@ -0,0 +1,72 @@ +Écrire ton premier ingrédient dégoûtant
+ +\--- task --- + +Ajoute un ingrédient dégoûtant et affiche-le à l'aide d'une f-string. + +\--- /task --- + +Commencer ta recette
+ +Le propriétaire d'un restaurant étrange a décidé d'utiliser du code pour aider à faire leurs recettes. Tu es le/la développeur·se qu'ils ont embauché. 🧑💻 +Ta mission : créer la fiche recette la plus dégoûtante de tous les temps 🤢 + +Commençons par ajouter ton premier ingrédient. Mais avant d'écrire n'importe quel code, tu remarqueras quelques lignes qui commencent par `#` — ce sont des **commentaires**. + +Les commentaires sont des notes dans ton code qui t'aident (et aident les autres !) à comprendre le rôle de chaque partie. Python les ignore lors de l'exécution de ton programme. + +Essaie maintenant ceci : + +1. Choisis un ingrédient dégoûtant comme de la « purée d'asticots 🐛 » ou de la « bave de limace 🐌 ». +2. Décide de la quantité que tu souhaites utiliser. Disons 50 grammes. +3. Utilise une **f-string** pour afficher la quantité et l'ingrédient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingrédients et quantités pour 1 personne + +ingrédient_1 = 'purée d'asticots 🐛' +quantité_1 = 50 + +# Nombre de portions + +# Ingrédients en plus grande quantité + +print(f'{amount_1}g de {ingredient_1}') + +\--- /code --- + ++ +++ +50 g de purée d'asticots 🐛++ +### Astuce + +Si ton code n'affiche rien ou présente une erreur, vérifie que : + +- Tu as utilisé des **guillemets** autour du nom de ton ingrédient (c'est une chaîne de caractères !) +- Tu as correctement orthographié les noms des variables +- Tu as utilisé le `f` avant la chaîne dans `print(f'...')` + ++ ++ +### Débogage + +- Si Python signale une erreur `NameError`, il se peut que tu aies une faute de frappe dans le nom de ta variable +- Si tu vois `{amount_1}` dans le résultat au lieu du nombre, assure-toi que ta chaîne commence par `f` + +diff --git a/fr-FR/step_2.md b/fr-FR/step_2.md new file mode 100644 index 0000000..7964700 --- /dev/null +++ b/fr-FR/step_2.md @@ -0,0 +1,58 @@ +Nourrir plus de personnes
+ +\--- task --- + +Ajoute une variable de portions et utilise-la pour adapter la quantité de ton ingrédient + +\--- /task --- + +Préparer pour plusieurs personnes !
+ +En ce moment, ta quantité d'ingrédients est pour seulement **une** personne. Mais que faire si tu veux nourrir 3, voire 10 personnes ? + +Au lieu d'écrire de nouveaux chiffres, tu peux **multiplier** le montant par le nombre de portions — en utilisant des mathématiques à l'intérieur de ta f-string ! + +Ajoutons une variable appelée `portions`, et mettons à jour ta ligne print pour l'utiliser : + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Nombre de portions + +portions = 3 + +# Ingrédients en plus grande quantité + +print(f'{quantité_1 \* portions}g de {ingredient_1}') + +\--- /code --- + ++ +++ +150 g de purée d'asticots 🐛++ +### Astuce + +Tu peux effectuer des calculs mathématiques à l'intérieur d'une f-string en utilisant `{}` — Python les effectue avant d'imprimer le message ! + ++ ++ +### Débogage + +- Assure-toi que le nom de ta variable est `portions`, et non `portion` ou `part` +- N'oublie pas l'astérisque (\*) pour la multiplication + +diff --git a/fr-FR/step_3.md b/fr-FR/step_3.md new file mode 100644 index 0000000..181a875 --- /dev/null +++ b/fr-FR/step_3.md @@ -0,0 +1,68 @@ +Ajouter plus d'ingrédients
+ +\--- task --- + +Ajoute deux autres ingrédients répugnants et augmente-les en utilisant des f-strings + +\--- /task --- + +Rendre ta recette plus dégoûtante
+ +Un ingrédient ne suffit jamais pour un plat dégoûtant ! Ajoutons deux ingrédients supplémentaires à ta recette. + +1. Ajoute `ingrédient_2` et `ingrédient_3` — donne-leur des noms dégoûtants comme « jus de chaussette 🧦 » ou « miettes d'ongles d'orteils 🦶 ». +2. Ajoute les valeurs correspondantes `quantité_2` et `quantité_3`. +3. Utilise les f-strings pour afficher **les trois ingrédients**, augmenté à l'aide de ta variable `portions`. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingrédient_2 = 'jus de chaussette 🧦' +quantité_2 = 30 + +ingrédient_3 = 'miettes d'ongles de pied 🦶' +quantité_3 = 10 + +# Nombre de portions + +portions = 3 + +# Ingrédients en plus grande quantité + +print(f'{quantité_1 \* portions} g de {ingredient_1}') +print(f'{quantité_2 \* portions} ml de {ingredient_2}') +print(f'{quantité_3 \* portions} g de {ingredient_3}') + +\--- /code --- + ++ +++ +150 g de purée d'asticots 🐛 +90 ml de jus de chaussettes 🧦 +30 g de miettes d'ongles de pied 🦶++ +### Astuce + +Tu peux étiqueter chaque ingrédient avec différentes unités comme `g` (grammes) ou `ml` (millilitres) selon ce que c'est ! + ++ ++ +### Débogage + +- Assure-toi que tes noms de variables correspondent exactement — Python est sensible à la casse ! +- N'oublie pas de multiplier par `portions` à l'intérieur de chaque f-string + +diff --git a/fr-FR/step_4.md b/fr-FR/step_4.md new file mode 100644 index 0000000..06cb2aa --- /dev/null +++ b/fr-FR/step_4.md @@ -0,0 +1,54 @@ +Commencer tes instructions de recette
+ +\--- task --- + +Utilise une f-string pour décrire le nombre de personnes et le premier ingrédient + +\--- /task --- + +Dire au chef ce qu'il doit faire
+ +Il est maintenant temps de transformer ta liste d'ingrédients en une véritable recette ! 🍲 + +La première étape consistera à décrire le nombre de personnes à nourrir et le premier ingrédient à ajouter. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Imprimer les instructions de la recette + +print() +print(f'Pour préparer cette recette dégoûtante pour {servings} personnes, ajoutez {quantité_1 \* portions} g de {ingredient_1} dans un grand bol.') + +\--- /code --- + ++ +++ +Pour préparer cette recette dégoûtante pour 3 personnes, ajoutez 150 g de purée d'asticots 🐛 dans un grand bol.++ +### Astuce + +Tu peux faire des **mathématiques à l'intérieur d'une f-string** ! +Cela te permet de calculer les quantités d'ingrédients et de les afficher dans une phrase sans avoir besoin de lignes de code supplémentaires. + ++ ++ +### Débogage + +- Assure-toi d'avoir utilisé `* portions` à l'intérieur des `{}` pour la quantité +- N'oublie pas le `f` au début de ta chaîne + +diff --git a/fr-FR/step_5.md b/fr-FR/step_5.md new file mode 100644 index 0000000..1f6cf30 --- /dev/null +++ b/fr-FR/step_5.md @@ -0,0 +1,92 @@ +Terminer ta recette dégoûtante
+ +\--- task --- + +Utilise davantage de f-strings pour décrire comment préparer tes ingrédients + +\--- /task --- + +Servir 🤢
+ +Terminons la recette en imprimant le reste de ces instructions dégoûtantes. + +Tu vas décrire : + +- Ce qu'il faut verser ensuite +- Comment le garnir de miettes +- Comment le servir à tes invités (mal)chanceux ! + +Ajoute ces dernières lignes à ton programme : + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Imprimer les instructions de la recette + +print() +print(f'Pour préparer cette recette dégoûtante pour {servings} personnes, ajoutez {quantité_1 \* portions} g de {ingredient_1} dans un grand bol.') +print() +print(f'Versez {quantité_2 \* portions} ml de {ingredient_2}.') +print() +print(f'Saupoudrez de {quantité_3 \* portions} g de {ingredient_3} et servez froid 🧊. Miam !') + +\--- /code --- + ++ +++ +Pour préparer cette recette dégoûtante pour 3 personnes, ajoutez 150 g de purée d'asticots 🐛 dans un grand bol. + +Versez 90 ml de jus de chaussette 🧦. + +Saupoudrez de 30 g de miettes d'ongles de pieds 🦶 et servez froid 🧊. Miam !+ ++ +### Astuce + +Ajoute `print()` sans rien dedans est un excellent moyen d'ajouter des lignes vides à ton résultat. +Tu peux combiner du texte, des variables et des mathématiques dans la même f-string ! + ++ ++ +### Débogage + +- Vérifie que chaque phrase est à l'intérieur d'un `print(f'...')` +- Fais attention à tes parenthèses et à ta ponctuation ! + ++ ++ +### Avis + +Il s'agit d'un projet bêta, ce qui signifie qu'il est tout nouveau et pas encore largement disponible. Si tu as testé ce projet individuellement ou avec ton club, n'hésite pas à nous faire part de ton avis. + + +Donner ton avis + +diff --git a/hi-IN/code/starter/main.py b/hi-IN/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/hi-IN/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/hi-IN/code/starter/project_config.yml b/hi-IN/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/hi-IN/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/hi-IN/images/banner.png b/hi-IN/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/hi-IN/images/banner.png differ diff --git a/hi-IN/mentor.md b/hi-IN/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/hi-IN/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/hi-IN/meta.yml b/hi-IN/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/hi-IN/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/hi-IN/resources/dataframe.json b/hi-IN/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/hi-IN/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/hi-IN/solutions/main.py b/hi-IN/solutions/main.py new file mode 100644 index 0000000..4564141 --- /dev/null +++ b/hi-IN/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. स्वादिष्ट!') diff --git a/hi-IN/step_1.md b/hi-IN/step_1.md new file mode 100644 index 0000000..ee16b36 --- /dev/null +++ b/hi-IN/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Tip + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Debugging + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/hi-IN/step_2.md b/hi-IN/step_2.md new file mode 100644 index 0000000..349fedb --- /dev/null +++ b/hi-IN/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Tip + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Debugging + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/hi-IN/step_3.md b/hi-IN/step_3.md new file mode 100644 index 0000000..23e2cc8 --- /dev/null +++ b/hi-IN/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Tip + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Debugging + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/hi-IN/step_4.md b/hi-IN/step_4.md new file mode 100644 index 0000000..0a3a807 --- /dev/null +++ b/hi-IN/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Tip + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Debugging + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/hi-IN/step_5.md b/hi-IN/step_5.md new file mode 100644 index 0000000..667ccb7 --- /dev/null +++ b/hi-IN/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. स्वादिष्ट!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Tip + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Debugging + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### Feedback + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/it-IT/code/starter/main.py b/it-IT/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/it-IT/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/it-IT/code/starter/project_config.yml b/it-IT/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/it-IT/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/it-IT/images/banner.png b/it-IT/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/it-IT/images/banner.png differ diff --git a/it-IT/mentor.md b/it-IT/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/it-IT/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/it-IT/meta.yml b/it-IT/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/it-IT/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/it-IT/resources/dataframe.json b/it-IT/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/it-IT/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/it-IT/solutions/main.py b/it-IT/solutions/main.py new file mode 100644 index 0000000..855cb24 --- /dev/null +++ b/it-IT/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!') diff --git a/it-IT/step_1.md b/it-IT/step_1.md new file mode 100644 index 0000000..ee16b36 --- /dev/null +++ b/it-IT/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Tip + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Debugging + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/it-IT/step_2.md b/it-IT/step_2.md new file mode 100644 index 0000000..349fedb --- /dev/null +++ b/it-IT/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Tip + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Debugging + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/it-IT/step_3.md b/it-IT/step_3.md new file mode 100644 index 0000000..23e2cc8 --- /dev/null +++ b/it-IT/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Tip + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Debugging + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/it-IT/step_4.md b/it-IT/step_4.md new file mode 100644 index 0000000..0a3a807 --- /dev/null +++ b/it-IT/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Tip + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Debugging + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/it-IT/step_5.md b/it-IT/step_5.md new file mode 100644 index 0000000..c0ad8a3 --- /dev/null +++ b/it-IT/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. Yum!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Tip + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Debugging + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### Feedback + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/ja-JP/code/starter/main.py b/ja-JP/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/ja-JP/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/ja-JP/code/starter/project_config.yml b/ja-JP/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/ja-JP/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/ja-JP/images/banner.png b/ja-JP/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/ja-JP/images/banner.png differ diff --git a/ja-JP/mentor.md b/ja-JP/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/ja-JP/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/ja-JP/meta.yml b/ja-JP/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/ja-JP/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/ja-JP/resources/dataframe.json b/ja-JP/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/ja-JP/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/ja-JP/solutions/main.py b/ja-JP/solutions/main.py new file mode 100644 index 0000000..855cb24 --- /dev/null +++ b/ja-JP/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!') diff --git a/ja-JP/step_1.md b/ja-JP/step_1.md new file mode 100644 index 0000000..ee16b36 --- /dev/null +++ b/ja-JP/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Tip + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Debugging + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/ja-JP/step_2.md b/ja-JP/step_2.md new file mode 100644 index 0000000..349fedb --- /dev/null +++ b/ja-JP/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Tip + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Debugging + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/ja-JP/step_3.md b/ja-JP/step_3.md new file mode 100644 index 0000000..23e2cc8 --- /dev/null +++ b/ja-JP/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Tip + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Debugging + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/ja-JP/step_4.md b/ja-JP/step_4.md new file mode 100644 index 0000000..0a3a807 --- /dev/null +++ b/ja-JP/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Tip + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Debugging + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/ja-JP/step_5.md b/ja-JP/step_5.md new file mode 100644 index 0000000..98cffa2 --- /dev/null +++ b/ja-JP/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. Yum!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Tip + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Debugging + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### フィードバック + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/nl-NL/code/starter/main.py b/nl-NL/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/nl-NL/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/nl-NL/code/starter/project_config.yml b/nl-NL/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/nl-NL/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/nl-NL/images/banner.png b/nl-NL/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/nl-NL/images/banner.png differ diff --git a/nl-NL/mentor.md b/nl-NL/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/nl-NL/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/nl-NL/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/nl-NL/resources/dataframe.json b/nl-NL/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/nl-NL/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do maths inside an f-string using `{}` — Python works it out before printing the message!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable name is `servings`, not `serving` or `serves`\n- Don’t forget the `*` for multiplication\n\n<\/div>\n" + }, + { + "filename": "step_3.md", + "path": "en\/", + "content": "Add more ingredients<\/h2>\n--- task ---\nAdd two more gross ingredients and scale them up using f-strings\n--- \/task ---\n\n
Make your recipe extra disgusting<\/h2>\n\nOne ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe.\n\n1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`.\n2. Add matching `amount_2` and `amount_3` values.\n3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 8-10,11-12,18-19\n---\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n--- \/code ---\n<\/div>\n\n\n150g of maggot mash 🐛\n90ml of sock juice 🧦\n30g of toenail sprinkles 🦶<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is!\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure your variable names match exactly — Python is case-sensitive!\n- Don’t forget to multiply by `servings` inside each f-string\n\n<\/div>\n" + }, + { + "filename": "step_4.md", + "path": "en\/", + "content": "Start your recipe instructions<\/h2>\n--- task ---\nUse an f-string to describe the number of people and the first ingredient\n--- \/task ---\n\n
Tell the chef what to do<\/h2>\n\nNow it’s time to turn your ingredient list into an actual recipe! 🍲\n\nYour first step will be to describe the number of people being fed and the first ingredient to be added.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 22-23\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.<\/pre>\n<\/div>\n\n\n\n### Tip\n\nYou can do **maths inside an f-string**! \nThis lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code.\n\n<\/div>\n\n\n\n### Debugging\n\n- Make sure you used `* servings` inside the `{}` for the amount\n- Don’t forget the `f` at the start of your string\n\n<\/div>\n" + }, + { + "filename": "step_5.md", + "path": "en\/", + "content": "Finish your disgusting recipe<\/h2>\n--- task ---\nUse more f-strings to describe how to prepare your ingredients\n--- \/task ---\n\n
Serve it up 🤢<\/h2>\n\nLet’s finish the recipe by printing the rest of the disgusting instructions.\n\nYou’ll describe:\n- What to pour in next\n- How to garnish it with sprinkles\n- How to serve it to your (un)lucky guests!\n\nAdd these final lines to your program:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 21\nline_highlights: 24-27\n---\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n--- \/code ---\n<\/div>\n\n\nTo make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.\n\nPour over 90ml of sock juice 🧦.\n\nSprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!<\/pre>\n<\/div>\n\n\n\n### Tip\n\nAdding `print()` with nothing in it is a great way to add blank lines in your output. \nYou can combine text, variables, and maths all in the same f-string!\n\n<\/div>\n\n\n\n### Debugging\n\n- Check that every sentence is inside a `print(f'...')`\n- Watch your brackets and punctuation carefully!\n\n<\/div>\n" + }, + { + "filename": "main.py", + "path": "en\/solutions\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n\ningredient_2 = 'sock juice 🧦'\namount_2 = 30\n\ningredient_3 = 'toenail sprinkles 🦶'\namount_3 = 10\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\nprint(f'{amount_2 * servings}ml of {ingredient_2}')\nprint(f'{amount_3 * servings}g of {ingredient_3}')\n\n# Print recipe instructions\nprint()\nprint(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.')\nprint()\nprint(f'Pour over {amount_2 * servings}ml of {ingredient_2}.')\nprint()\nprint(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!')\n" + }, + { + "filename": "README.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Python bytes - Gross groceries\n\n\n\nProject description\n\nFind the project online at [projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries](https:\/\/projects.raspberrypi.org\/en\/projects\/python-bytes-gross-groceries)\n\n## Resources\nFor project materials and solutions, see [en\/resources](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/resources) and [en\/solutions](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/tree\/master\/en\/solutions).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Licence\nSee [LICENCE.md](LICENCE.md)\n" + }, + { + "filename": "CONTRIBUTING.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Contributing\n\nAll contributions are assumed to be licensed under the same licence as the source, i.e. [CC BY-SA](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/). This licence must remain in all derivatives of this work.\n\n## Issues\n\nIf you find a mistake, bug, or other problem, please [open an issue](https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries\/issues) in this repository.\n\n## Pull requests\n\nAll edits to a resource should be made to the draft branch or to a fork of the repo. These patches can then be submitted as a pull request.\n\nIf you fix a mistake, bug, or problem or have something to contribute, please create a pull request for each modification. Please consider grouping modifications sensibly, e.g. don't bundle typo fixes in the same pull request as code changes, file them separately instead.\n\nPlease note that sometimes things are done for pedagogical reasons so changes which make sense from a software engineering perspective (reducing duplication or making use of more advanced programming language features) may not be suitable to maintain the intended educational value.\n\n## Derivatives\n\nSee [LICENCE.md](LICENCE.md) for content licence. The licence must remain in all derivatives of this work.\n\n## Translation\n\nYou can help us make this project available to more people around the world by translating it. For more information, please go to [rpf.io\/translate](https:\/\/rpf.io\/translate).\n" + }, + { + "filename": "LICENCE.md", + "path": "python-bytes-gross-groceries\/", + "content": "# Licence\n\nUnless otherwise specified, everything in this repository is covered by the following licence:\n\n[](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/)\n\n**Python bytes - Gross groceries** by the [Raspberry Pi Foundation](http:\/\/www.raspberrypi.org) is licensed under a [Creative Commons Attribution 4.0 International licence](http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/).\n\nBased on a work at https:\/\/github.com\/raspberrypilearning\/python-bytes-gross-groceries.\n" + }, + { + "filename": "crowdin.yml", + "path": "python-bytes-gross-groceries\/", + "content": "files:\n - source: \/en\/**\/*.*\n translation: \/%locale%\/**\/%original_file_name%\n" + } +] \ No newline at end of file diff --git a/nl-NL/solutions/main.py b/nl-NL/solutions/main.py new file mode 100644 index 0000000..855cb24 --- /dev/null +++ b/nl-NL/solutions/main.py @@ -0,0 +1,27 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 +# Number of servings +servings = 3 + +# Scaled-up ingredients +print(f'{amount_1 * servings}g of {ingredient_1}') +print(f'{amount_2 * servings}ml of {ingredient_2}') +print(f'{amount_3 * servings}g of {ingredient_3}') + +# Print recipe instructions +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 * servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 * servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 * servings}g of {ingredient_3} and serve cold 🧊. Yum!') diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md new file mode 100644 index 0000000..1f2980d --- /dev/null +++ b/nl-NL/step_1.md @@ -0,0 +1,72 @@ +Write your first disgusting ingredient
+ +\--- task --- + +Add a gross ingredient and print it using an f-string. + +\--- /task --- + +Start your recipe
+ +The owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 +Your job is to help create the grossest recipe card ever 🤢 + +Let’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**. + +Comments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs. + +Now try this: + +1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`. +2. Decide how much of it you want to use. Let’s say `50` grams. +3. Use an **f-string** to print the amount and the ingredient. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 5-6,11 +--- + +# Ingredients and amounts for 1 person + +ingredient_1 = 'maggot mash 🐛' +amount_1 = 50 + +# Number of servings + +# Scaled-up ingredients + +print(f'{amount_1}g of {ingredient_1}') + +\--- /code --- + ++ +++ +50g of maggot mash 🐛++ +### Tip + +If your code prints nothing or shows an error, check that: + +- You used **quotes** around your ingredient name (it's a string!) +- You’ve spelled the variable names correctly +- You used the `f` before the string in `print(f'...')` + ++ ++ +### Foutopsporing + +- If Python says there's a `NameError`, you may have a typo in your variable name +- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f` + +diff --git a/nl-NL/step_2.md b/nl-NL/step_2.md new file mode 100644 index 0000000..d7c116b --- /dev/null +++ b/nl-NL/step_2.md @@ -0,0 +1,58 @@ +Feed more people
+ +\--- task --- + +Add a servings variable and use it to scale up your ingredient + +\--- /task --- + +Make it serve more than one!
+ +Right now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people? + +Instead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string! + +Let’s add a variable called `servings`, and update your print line to use it: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 7 +line_highlights: 8,11 +--- + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛++ +### Tip + +You can do maths inside an f-string using `{}` — Python works it out before printing the message! + ++ ++ +### Foutopsporing + +- Make sure your variable name is `servings`, not `serving` or `serves` +- Don’t forget the `*` for multiplication + +diff --git a/nl-NL/step_3.md b/nl-NL/step_3.md new file mode 100644 index 0000000..871eb96 --- /dev/null +++ b/nl-NL/step_3.md @@ -0,0 +1,68 @@ +Add more ingredients
+ +\--- task --- + +Add two more gross ingredients and scale them up using f-strings + +\--- /task --- + +Make your recipe extra disgusting
+ +One ingredient is never enough for a proper disgusting dish! Let's add two more ingredients to your recipe. + +1. Add `ingredient_2` and `ingredient_3` — give them gross names like `'sock juice 🧦'` or `'toenail sprinkles 🦶'`. +2. Add matching `amount_2` and `amount_3` values. +3. Use f-strings to print out **all three ingredients**, scaled up using your `servings` variable. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 3 +line_highlights: 8-10,11-12,18-19 +--- + +ingredient_2 = 'sock juice 🧦' +amount_2 = 30 + +ingredient_3 = 'toenail sprinkles 🦶' +amount_3 = 10 + +# Number of servings + +servings = 3 + +# Scaled-up ingredients + +print(f'{amount_1 \* servings}g of {ingredient_1}') +print(f'{amount_2 \* servings}ml of {ingredient_2}') +print(f'{amount_3 \* servings}g of {ingredient_3}') + +\--- /code --- + ++ +++ +150g of maggot mash 🐛 +90ml of sock juice 🧦 +30g of toenail sprinkles 🦶++ +### Tip + +You can label each ingredient with different units like `g` (grams) or `ml` (millilitres) depending on what it is! + ++ ++ +### Foutopsporing + +- Make sure your variable names match exactly — Python is case-sensitive! +- Don’t forget to multiply by `servings` inside each f-string + +diff --git a/nl-NL/step_4.md b/nl-NL/step_4.md new file mode 100644 index 0000000..ba577e9 --- /dev/null +++ b/nl-NL/step_4.md @@ -0,0 +1,54 @@ +Start your recipe instructions
+ +\--- task --- + +Use an f-string to describe the number of people and the first ingredient + +\--- /task --- + +Tell the chef what to do
+ +Now it’s time to turn your ingredient list into an actual recipe! 🍲 + +Your first step will be to describe the number of people being fed and the first ingredient to be added. + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 22-23 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl.++ +### Tip + +You can do **maths inside an f-string**! +This lets you calculate the ingredient amounts and show them inside a sentence without needing extra lines of code. + ++ ++ +### Foutopsporing + +- Make sure you used `* servings` inside the `{}` for the amount +- Don’t forget the `f` at the start of your string + +diff --git a/nl-NL/step_5.md b/nl-NL/step_5.md new file mode 100644 index 0000000..00b59d4 --- /dev/null +++ b/nl-NL/step_5.md @@ -0,0 +1,92 @@ +Finish your disgusting recipe
+ +\--- task --- + +Use more f-strings to describe how to prepare your ingredients + +\--- /task --- + +Serve it up 🤢
+ +Let’s finish the recipe by printing the rest of the disgusting instructions. + +You’ll describe: + +- What to pour in next +- How to garnish it with sprinkles +- How to serve it to your (un)lucky guests! + +Add these final lines to your program: + ++--- code --- +--- +language: python +filename: main.py +line_numbers: true +line_number_start: 21 +line_highlights: 24-27 +--- + +# Print recipe instructions + +print() +print(f'To make this revolting recipe for {servings} people add {amount_1 \* servings}g of {ingredient_1} to a large bowl.') +print() +print(f'Pour over {amount_2 \* servings}ml of {ingredient_2}.') +print() +print(f'Sprinkle with {amount_3 \* servings}g of {ingredient_3} and serve cold 🧊. Yum!') + +\--- /code --- + ++ +++ +To make this revolting recipe for 3 people add 150g of maggot mash 🐛 to a large bowl. + +Pour over 90ml of sock juice 🧦. + +Sprinkle with 30g of toenail sprinkles 🦶 and serve cold 🧊. Yum!+ ++ +### Tip + +Adding `print()` with nothing in it is a great way to add blank lines in your output. +You can combine text, variables, and maths all in the same f-string! + ++ ++ +### Foutopsporing + +- Check that every sentence is inside a `print(f'...')` +- Watch your brackets and punctuation carefully! + ++ ++ +### Terugkoppeling + +This is a beta projects, which means it is brand new and not widely available. If you've tested this project on your own or with your club, let us know what you think. + + +Give feedback + +diff --git a/pt-BR/code/starter/main.py b/pt-BR/code/starter/main.py new file mode 100644 index 0000000..45d5a6a --- /dev/null +++ b/pt-BR/code/starter/main.py @@ -0,0 +1,12 @@ +# Gross Groceries recipe card + +# Ingredients and amounts for 1 person + + +# Number of servings + + +# Scaled-up ingredients + + +# Print recipe instructions diff --git a/pt-BR/code/starter/project_config.yml b/pt-BR/code/starter/project_config.yml new file mode 100644 index 0000000..d184c95 --- /dev/null +++ b/pt-BR/code/starter/project_config.yml @@ -0,0 +1,4 @@ +name: "Python Bytes - Gross Groceries" +identifier: "python-bytes-gross-groceries" +type: python +build: true diff --git a/pt-BR/images/banner.png b/pt-BR/images/banner.png new file mode 100644 index 0000000..685e0cf Binary files /dev/null and b/pt-BR/images/banner.png differ diff --git a/pt-BR/mentor.md b/pt-BR/mentor.md new file mode 100644 index 0000000..fe5ddcf --- /dev/null +++ b/pt-BR/mentor.md @@ -0,0 +1,30 @@ +# Mentor Notes: Gross Groceries + +## Project Overview + +In this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps. + +--- + +## What Learners Will Practise + +- Creating and using variables +- Combining strings and numbers with f-strings +- Performing basic multiplication in code +- Writing multi-line Python programs with clear structure + +--- + +## Teaching Tips + +- Encourage learners to come up with their own disgusting ingredients — the sillier, the better! +- Prompt them to read printed output carefully to understand the effect of their changes. +- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols. + +--- + +## Extension Ideas + +- Let learners use `input()` to ask how many people the recipe should serve +- Encourage them to use `\n` to format multi-line recipe cards +- Add even more ingredients or steps to the recipe diff --git a/pt-BR/meta.yml b/pt-BR/meta.yml new file mode 100644 index 0000000..330e5c4 --- /dev/null +++ b/pt-BR/meta.yml @@ -0,0 +1,20 @@ +title: Python bytes - Gross groceries +hero_image: images/banner.png +description: Write a revolting recipe card using variables, f-strings, and maths +meta_title: Learn to code with Gross Groceries | Python Bytes +meta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant. +version: 1 +listed: true +copyedit: false +last_tested: "2025-04-14" +steps: + - title: step_1 + - title: step_2 + completion: + - engaged + - title: step_3 + - title: step_4 + - title: step_5 + completion: + - internal + - external diff --git a/pt-BR/resources/dataframe.json b/pt-BR/resources/dataframe.json new file mode 100644 index 0000000..c7460c9 --- /dev/null +++ b/pt-BR/resources/dataframe.json @@ -0,0 +1,72 @@ +[ + { + "filename": "meta.yml", + "path": "en\/", + "content": "title: Python bytes - Gross groceries\nhero_image: images\/banner.png\ndescription: Write a revolting recipe card using variables, f-strings, and maths\nmeta_title: Learn to code with Gross Groceries | Python Bytes\nmeta_description: Learn how to use Python f-strings and variables to print a disgusting recipe for an odd restaurant.\nversion: 1\nlisted: false\ncopyedit: false\nlast_tested: \"2025-04-14\"\nsteps:\n - title: step_1\n - title: step_2\n completion:\n - engaged\n - title: step_3\n - title: step_4\n - title: step_5\n completion:\n - internal\n - external\n" + }, + { + "filename": "main.py", + "path": "en\/code\/starter\/", + "content": "# Gross Groceries recipe card\n\n# Ingredients and amounts for 1 person\n\n\n# Number of servings\n\n\n# Scaled-up ingredients\n\n\n# Print recipe instructions\n" + }, + { + "filename": "project_config.yml", + "path": "en\/code\/starter\/", + "content": "name: \"Python Bytes - Gross Groceries\"\nidentifier: \"python-bytes-gross-groceries\"\ntype: python\nbuild: true\n" + }, + { + "filename": "mentor.md", + "path": "en\/", + "content": "# Mentor Notes: Gross Groceries\n\n## Project Overview\n\nIn this project, learners will use Python to help a strange restaurant owner create a revolting recipe card. They’ll start with simple ingredients and build up to printing full recipe instructions using f-strings. By the end, learners will have used variables, strings, numbers, simple arithmetic, and f-strings across multiple steps.\n\n---\n\n## What Learners Will Practise\n\n- Creating and using variables\n- Combining strings and numbers with f-strings\n- Performing basic multiplication in code\n- Writing multi-line Python programs with clear structure\n\n---\n\n## Teaching Tips\n\n- Encourage learners to come up with their own disgusting ingredients — the sillier, the better!\n- Prompt them to read printed output carefully to understand the effect of their changes.\n- Reinforce that f-strings are a powerful way to combine text and values without needing multiple `+` symbols.\n\n---\n\n## Extension Ideas\n\n- Let learners use `input()` to ask how many people the recipe should serve\n- Encourage them to use `\\n` to format multi-line recipe cards\n- Add even more ingredients or steps to the recipe\n" + }, + { + "filename": "step_1.md", + "path": "en\/", + "content": "Write your first disgusting ingredient<\/h2>\n--- task ---\nAdd a gross ingredient and print it using an f-string\n--- \/task ---\n\n
Start your recipe<\/h2>\n\nThe owner of an odd restaurant has decided to use code to help make their recipes. You're the coder they've hired. 🧑💻 \nYour job is to help create the grossest recipe card ever 🤢\n\nLet’s start by adding your first ingredient. But before we write any code, you’ll notice some lines that start with `#` — these are **comments**.\n\nComments are notes in your code that help you (and others!) understand what each part does. Python ignores them when your program runs.\n\nNow try this:\n\n1. Choose a disgusting ingredient like `'maggot mash 🐛'` or `'slug slime 🐌'`.\n2. Decide how much of it you want to use. Let’s say `50` grams.\n3. Use an **f-string** to print the amount and the ingredient.\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 3\nline_highlights: 5-6,11\n---\n# Ingredients and amounts for 1 person\n\ningredient_1 = 'maggot mash 🐛'\namount_1 = 50\n# Number of servings\n\n\n# Scaled-up ingredients\nprint(f'{amount_1}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n\n50g of maggot mash 🐛<\/pre>\n<\/div>\n\n\n\n### Tip\n\nIf your code prints nothing or shows an error, check that:\n- You used **quotes** around your ingredient name (it's a string!)\n- You’ve spelled the variable names correctly\n- You used the `f` before the string in `print(f'...')`\n\n<\/div>\n\n\n\n### Debugging\n\n- If Python says there's a `NameError`, you may have a typo in your variable name\n- If you see `{amount_1}` in the output instead of the number, make sure your string starts with `f`\n\n<\/div>\n" + }, + { + "filename": "step_2.md", + "path": "en\/", + "content": "Feed more people<\/h2>\n--- task ---\nAdd a servings variable and use it to scale up your ingredient\n--- \/task ---\n\n
Make it serve more than one!<\/h2>\n\nRight now, your ingredient amount is for just **one** person. But what if you wanted to feed 3, or even 10 people?\n\nInstead of writing new numbers, you can **multiply** the amount by the number of servings — using maths inside your f-string!\n\nLet’s add a variable called `servings`, and update your print line to use it:\n\n
\n--- code ---\n---\nlanguage: python\nfilename: main.py\nline_numbers: true\nline_number_start: 7\nline_highlights: 8,11\n---\n# Number of servings\nservings = 3\n\n# Scaled-up ingredients\nprint(f'{amount_1 * servings}g of {ingredient_1}')\n--- \/code ---\n<\/div>\n\n