← back to unit
Easy
# breaking it down easy
The Recipe Doubler
Grandma's recipe feeds 4 — tonight you're feeding a small army. 👵
You get the recipe as ingredient:amount pairs and a factor to multiply by. Print the scaled recipe in the same order, same format, comma-separated.
Example:
Input: pairs = "flour:2,sugar:1,eggs:3", factor = 2
Output: flour:4,sugar:2,eggs:6
Each amount gets multiplied by 2 while the ingredient names and their order stay exactly the same.
💡 need a hint?
brk-recipe-doubler.py🔒 given lines are locked — write your code in between
loading...