Get startedGet started for free

Finding the average

Your next task is to check delivery times during peak dinner hours (6-9 PM) for a restaurant to optimize platform performance. You have a delivery_times list containing delivery times in minutes.

Let's use the built-in functions to calculate the average delivery time.

This exercise is part of the course

Intermediate Python for Developers

View Course

Exercise instructions

  • Find the average delivery time, saving as average_time.
  • Round the average_time to two decimal places, saving as average_rounded.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

delivery_times = [19, 25, 35, 40, 28, 32, 29, 31]

# Find the average delivery time
average_time = ____(delivery_times) / ____(delivery_times)

# Round the average delivery time to two decimal places
average_rounded = ____(____, ____)

print("Average delivery time:", average_rounded)
Edit and Run Code