From 4fcb46edd79efae2f988bfa2eb313b172c188545 Mon Sep 17 00:00:00 2001 From: Shubham Singla <85898737+Haubilau@users.noreply.github.com> Date: Fri, 8 May 2026 14:31:45 +0530 Subject: [PATCH] Update lasagna.py --- .../guidos-gorgeous-lasagna/lasagna.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/exercises/concept/guidos-gorgeous-lasagna/lasagna.py b/exercises/concept/guidos-gorgeous-lasagna/lasagna.py index 0e1a50d571e..ce87e2e8877 100644 --- a/exercises/concept/guidos-gorgeous-lasagna/lasagna.py +++ b/exercises/concept/guidos-gorgeous-lasagna/lasagna.py @@ -9,10 +9,10 @@ #TODO: define your EXPECTED_BAKE_TIME (required) and PREPARATION_TIME (optional) constants below. - +EXPECTED_BAKE_TIME = 40 #TODO: Remove 'pass' and complete the 'bake_time_remaining()' function below. -def bake_time_remaining(): +def bake_time_remaining(n): """Calculate the bake time remaining. :param elapsed_bake_time: int - baking time already elapsed. @@ -23,18 +23,25 @@ def bake_time_remaining(): based on the `EXPECTED_BAKE_TIME`. """ - pass + return EXPECTED_BAKE_TIME-n #TODO: Define the 'preparation_time_in_minutes()' function below. # To avoid the use of magic numbers (see: https://en.wikipedia.org/wiki/Magic_number_(programming)), you should define a PREPARATION_TIME constant. # You can do that on the line below the 'EXPECTED_BAKE_TIME' constant. # This will make it easier to do calculations, and make changes to your code. - - +PREPARATION_TIME = 2 +def preparation_time_in_minutes(layer): + """ + calculates prepration time + """ + return layer*PREPARATION_TIME + #TODO: define the 'elapsed_time_in_minutes()' function below. - +def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time): + """ calculates the elaped total time""" + return number_of_layers*PREPARATION_TIME+elapsed_bake_time # TODO: Remember to go back and add docstrings to all your functions