-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOven calcs
More file actions
41 lines (31 loc) · 995 Bytes
/
Oven calcs
File metadata and controls
41 lines (31 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(total_spent):
"""
Calculate the remaining bake time.
Args:
x (int): The time already spent baking.
Returns:
int: Remaining bake time in minutes.
"""
return EXPECTED_BAKE_TIME - total_spent
def preparation_time_in_minutes(number_of_layers):
"""
Calculate the total preparation time.
Args:
number_of_layers (int): The number of layers to prepare.
Returns:
int: Preparation time in minutes.
"""
return PREPARATION_TIME * number_of_layers
print(preparation_time_in_minutes(5))
def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
"""
Calculate the total elapsed time.
Args:
number_of_layers (int): The number of layers prepared.
elapsed_bake_time (int): Time already spent baking.
Returns:
int: Total elapsed cooking time.
"""
return number_of_layers * 2 + elapsed_bake_time