Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion exercises/concept/guidos-gorgeous-lasagna/.docs/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

- You need to define a [function][defining functions] with a single parameter representing the number of layers.
- Use the [mathematical operator for multiplication][numbers] to multiply values.
- You could define an extra _constant_ for the time in minutes per layer rather than using a "magic number" in your code.
- You can define a PREPARATION_TIME _constant_ for the time in minutes per layer rather than using a ["magic
number"][magic-numbers] in your code.
- This function should [return a value][return].

## 4. Calculate total elapsed cooking time (prep + bake) in minutes
Expand All @@ -43,6 +44,7 @@
[constants]: https://stackoverflow.com/a/2682752
[defining functions]: https://docs.python.org/3/tutorial/controlflow.html#defining-functions
[docstrings]: https://docs.python.org/3/tutorial/controlflow.html#tut-docstrings
[magic-numbers]: https://en.wikipedia.org/wiki/Magic_number_(programming)
[naming]: https://realpython.com/python-variables/
[numbers]: https://docs.python.org/3/tutorial/introduction.html#numbers
[pep257]: https://www.python.org/dev/peps/pep-0257/
Expand Down
12 changes: 9 additions & 3 deletions exercises/concept/guidos-gorgeous-lasagna/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ Assume each layer takes 2 minutes to prepare.
```


## 4. Calculate total elapsed cooking time (prep + bake) in minutes
## 4. Calculate total elapsed time (prepping + baking) in minutes

Define the `elapsed_time_in_minutes()` function that takes two parameters as arguments:

- `number_of_layers` (_the number of layers added to the lasagna_)
- `elapsed_bake_time` (_the number of minutes the lasagna has spent baking in the oven already_).

This function should return the total minutes you have been in the kitchen cooking — your preparation time layering +
the time the lasagna has spent baking in the oven.

Define the `elapsed_time_in_minutes()` function that takes two parameters as arguments: `number_of_layers` (_the number of layers added to the lasagna_) and `elapsed_bake_time` (_the number of minutes the lasagna has been baking in the oven_).
This function should return the total number of minutes you have been cooking, or the sum of your preparation time and the time the lasagna has already spent baking in the oven.

```python
>>> def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
Expand Down
6 changes: 3 additions & 3 deletions exercises/concept/guidos-gorgeous-lasagna/lasagna.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""


#TODO: define the 'EXPECTED_BAKE_TIME' constant below.
#TODO: define your EXPECTED_BAKE_TIME (required) and PREPARATION_TIME (optional) constants below.


#TODO: Remove 'pass' and complete the 'bake_time_remaining()' function below.
Expand All @@ -27,9 +27,9 @@ def bake_time_remaining():


#TODO: Define the 'preparation_time_in_minutes()' function below.
# You might also consider defining a 'PREPARATION_TIME' constant.
# 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.
# This will make it easier to do calculations, and make changes to your code.



Expand Down
Loading