Skip to content

Commit 4fcb46e

Browse files
authored
Update lasagna.py
1 parent 7f60cef commit 4fcb46e

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

  • exercises/concept/guidos-gorgeous-lasagna

exercises/concept/guidos-gorgeous-lasagna/lasagna.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010

1111
#TODO: define your EXPECTED_BAKE_TIME (required) and PREPARATION_TIME (optional) constants below.
12-
12+
EXPECTED_BAKE_TIME = 40
1313

1414
#TODO: Remove 'pass' and complete the 'bake_time_remaining()' function below.
15-
def bake_time_remaining():
15+
def bake_time_remaining(n):
1616
"""Calculate the bake time remaining.
1717
1818
:param elapsed_bake_time: int - baking time already elapsed.
@@ -23,18 +23,25 @@ def bake_time_remaining():
2323
based on the `EXPECTED_BAKE_TIME`.
2424
"""
2525

26-
pass
26+
return EXPECTED_BAKE_TIME-n
2727

2828

2929
#TODO: Define the 'preparation_time_in_minutes()' function below.
3030
# To avoid the use of magic numbers (see: https://en.wikipedia.org/wiki/Magic_number_(programming)), you should define a PREPARATION_TIME constant.
3131
# You can do that on the line below the 'EXPECTED_BAKE_TIME' constant.
3232
# This will make it easier to do calculations, and make changes to your code.
33-
34-
33+
PREPARATION_TIME = 2
34+
def preparation_time_in_minutes(layer):
35+
"""
36+
calculates prepration time
37+
"""
38+
return layer*PREPARATION_TIME
39+
3540

3641
#TODO: define the 'elapsed_time_in_minutes()' function below.
37-
42+
def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
43+
""" calculates the elaped total time"""
44+
return number_of_layers*PREPARATION_TIME+elapsed_bake_time
3845

3946

4047
# TODO: Remember to go back and add docstrings to all your functions

0 commit comments

Comments
 (0)