IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Intermediate Python for Developers

Visualizza il corso

Istruzioni dell'esercizio

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

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

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)
Modifica ed esegui il codice