#Respond only in code

1 messages · Page 1 of 1 (latest)

calm frost
#

added useful/work related tag

#

very cool

edgy gull
#
    def __init__(self, name, ingredients, instructions):
        self.name = name
        self.ingredients = ingredients
        self.instructions = instructions

    def print_recipe(self):
        print(f"Recipe: {self.name}\n")
        print("Ingredients:")
        for ingredient in self.ingredients:
            print(f"- {ingredient}")
        print("\nInstructions:")
        for step in self.instructions:
            print(f"{step}")

jacket_potato_recipe = Recipe(
    "Jacket Potato",
    [
        "1 large russet potato",
        "1 tablespoon of olive oil",
        "Salt to taste",
        "Toppings of choice (e.g., butter, sour cream, cheddar cheese, chives)"
    ],
    [
        "Preheat your oven to 425°F (220°C).",
        "Wash the potato thoroughly and dry it off.",
        "Prick the potato with a fork a few times on each side.",
        "Rub the potato with olive oil and sprinkle with salt.",
        "Place the potato on a baking sheet and bake for about 45-60 minutes, or until the potato is easily pierced with a fork.",
        "Remove the potato from the oven and let it cool for a few minutes.",
        "Cut the potato open and fluff the inside with a fork.",
        "Add your favorite toppings and serve immediately."
    ]
)

jacket_potato_recipe.print_recipe()```
#

Its good but you should probably allow it to include code comments to explain what's going on so long as its inside the code block