1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Python for Developers

Connected

Exercise

Report-generating function

You learned that functions can return values, but they can also print results.

Your development team needs regular reports on test execution times. Instead of manually calculating these metrics each time, you'll create a custom function called test_report that prints a formatted summary without returning any values.

A test_durations list with test execution times in seconds is provided for you.

Instructions

100 XP
  • Complete the function definition by adding durations as the argument.
  • Calculate the total test time by using a built-in function on the durations.
  • Generate the report for recent tests by calling the function on the test_durations list.