Hi again
i had followed your advise, thank for this wise’s ones.
here is my written, i tried to have 4 identation for the second line of def ::
EXPECTED_BAKE_TIME=40
def bake_time_remaining(elapsed_bake_time):
return EXPECTED_BAKE_TIME - elapsed_bake_time
“”“return the bake time left”“”
def preparation_time_in_minutes(number_of_layers):
preparation_time=2
return number_of_layers * preparation_time
“”“return the preparation time taken per layer’s quantity”“”
def elapsed_time_in_minutes(number_of_layers,elapsed_bake_time):
return number_of_layers + elapsed_bake_time
“”“return prep time + bake time “””
i had passed the 3 first tasks but the 4th and 5th no , here is the feedback :
tasks4 ::
CODE RUN
layer_data = (1, 2, 5, 8, 11, 15)
time_data = (3, 7, 8, 4, 15, 20)
result_data = [5, 11, 18, 20, 37, 50]
for variant, (layers, time, expected) in enumerate(zip(layer_data, time_data, result_data), start=1):
with self.subTest(f'variation #{variant}', layers=layers, time=time, expected=expected):
actual_result = elapsed_time_in_minutes(layers, time)
failure_msg = (f'Called elapsed_time_in_minutes({layers}, {time}). '
f'The function returned {actual_result}, but the tests '
f'expected {expected} as the elapsed time.')
self.assertEqual(actual_result, expected, msg=failure_msg)
TEST FAILURE
One or more variations of this test failed. Details can be found under each [variant#].
tasks 5:: he show me 6 variants failure , here is one of it ::
variant 1
CODE RUN
layer_data = (1, 2, 5, 8, 11, 15)
time_data = (3, 7, 8, 4, 15, 20)
result_data = [5, 11, 18, 20, 37, 50]
for variant, (layers, time, expected) in enumerate(zip(layer_data, time_data, result_data), start=1):
with self.subTest(f'variation #{variant}', layers=layers, time=time, expected=expected):
actual_result = elapsed_time_in_minutes(layers, time)
failure_msg = (f'Called elapsed_time_in_minutes({layers}, {time}). '
f'The function returned {actual_result}, but the tests '
f'expected {expected} as the elapsed time.')
self.assertEqual(actual_result, expected, msg=failure_msg)
TEST FAILURE
AssertionError: 4 != 5 : Called elapsed_time_in_minutes(1, 3). The function returned 4, but the tests expected 5 as the elapsed time.
variant 2 ::
TEST FAILURE
AssertionError: 9 != 11 : Called elapsed_time_in_minutes(2, 7). The function returned 9, but the tests expected 11 as the elapsed time.
variant 3::
AssertionError: 13 != 18 : Called elapsed_time_in_minutes(5, 8). The function returned 13, but the tests expected 18 as the elapsed time.
and same conclusion until variant 6 , i wonder where he found these variants since i didn’t writte it !
thank you in advance
PS: i tried this code in jupyther and it ran