From 17f77c82425fc71e4b73ee80c7920b23e2817721 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 08:42:24 +0000 Subject: [PATCH 1/2] [Sync Iteration] python/guidos-gorgeous-lasagna/1 --- .../guidos-gorgeous-lasagna/1/lasagna.py | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 solutions/python/guidos-gorgeous-lasagna/1/lasagna.py diff --git a/solutions/python/guidos-gorgeous-lasagna/1/lasagna.py b/solutions/python/guidos-gorgeous-lasagna/1/lasagna.py new file mode 100644 index 0000000000..a628118a7e --- /dev/null +++ b/solutions/python/guidos-gorgeous-lasagna/1/lasagna.py @@ -0,0 +1,52 @@ +"""Functions used in preparing Guido's gorgeous lasagna. + +Learn about Guido, the creator of the Python language: +https://en.wikipedia.org/wiki/Guido_van_Rossum + +This is a module docstring, used to describe the functionality +of a module and its functions and/or classes. +""" + +EXPECTED_BAKE_TIME = 40 +PREPARATION_TIME = 2 + + +def bake_time_remaining(elapsed_bake_time): + """Calculate the bake time remaining. + + :param elapsed_bake_time: int - baking time already elapsed. + :return: int - remaining bake time (in minutes) derived from 'EXPECTED_BAKE_TIME'. + + Function that takes the actual minutes the lasagna has been in the oven as + an argument and returns how many minutes the lasagna still needs to bake + based on the `EXPECTED_BAKE_TIME`. + """ + return EXPECTED_BAKE_TIME - elapsed_bake_time + +def preparation_time_in_minutes(number_of_layers): + """Calculate the preperation time based on layers. + + :param number_of_layers: int - the number of layers. + :return: int - the preperation time it takes in minutes based on number of layers and PREPARATION_TIME. + + Function that takes the number of layers we want to add to the lasagna and returns how many minutes we would spend making them. + """ + + return number_of_layers * PREPARATION_TIME + +def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time): + + """Calculate the elapsed cooking time. + + :param number_of_layers: int - the number of layers in the lasagna. + :param elapsed_bake_time: int - elapsed cooking time. + :return: int - total time elapsed (in minutes) preparing and cooking. + + This function takes two integers representing the number of lasagna layers and the + time already spent baking and calculates the total elapsed minutes spent cooking the + lasagna. + """ + + return preparation_time_in_minutes(number_of_layers) + elapsed_bake_time + + From 339d9c66d0c7a88fe3a0c5e8da34689d49e99221 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 08:42:25 +0000 Subject: [PATCH 2/2] [Sync Iteration] python/guidos-gorgeous-lasagna/2 --- .../guidos-gorgeous-lasagna/2/lasagna.py | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 solutions/python/guidos-gorgeous-lasagna/2/lasagna.py diff --git a/solutions/python/guidos-gorgeous-lasagna/2/lasagna.py b/solutions/python/guidos-gorgeous-lasagna/2/lasagna.py new file mode 100644 index 0000000000..b7531c5415 --- /dev/null +++ b/solutions/python/guidos-gorgeous-lasagna/2/lasagna.py @@ -0,0 +1,50 @@ +"""Functions used in preparing Guido's gorgeous lasagna. + +Learn about Guido, the creator of the Python language: +https://en.wikipedia.org/wiki/Guido_van_Rossum + +This is a module docstring, used to describe the functionality +of a module and its functions and/or classes. +""" + +EXPECTED_BAKE_TIME = 40 +PREPARATION_TIME = 2 + + +def bake_time_remaining(elapsed_bake_time): + """Calculate the bake time remaining. + + :param elapsed_bake_time: int - baking time already elapsed. + :return: int - remaining bake time (in minutes) derived from 'EXPECTED_BAKE_TIME'. + + Function that takes the actual minutes the lasagna has been in the oven as + an argument and returns how many minutes the lasagna still needs to bake + based on the `EXPECTED_BAKE_TIME`. + """ + return EXPECTED_BAKE_TIME - elapsed_bake_time + +def preparation_time_in_minutes(number_of_layers): + """Calculate the preperation time based on layers. + + :param number_of_layers: int - the number of layers. + :return: int - the preperation time it takes in minutes based on number of layers and PREPARATION_TIME. + + Function that takes the number of layers we want to add to the lasagna and returns how many minutes we would spend making them. + """ + + return number_of_layers * PREPARATION_TIME + +def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time): + + """Calculate the elapsed cooking time. + + :param number_of_layers: int - the number of layers in the lasagna. + :param elapsed_bake_time: int - elapsed cooking time. + :return: int - total time elapsed (in minutes) preparing and cooking. + + This function takes two integers representing the number of lasagna layers and the + time already spent baking and calculates the total elapsed minutes spent cooking the + lasagna. + """ + + return preparation_time_in_minutes(number_of_layers) + elapsed_bake_time