평균 구하기
이번 과제에서는 레스토랑의 저녁 피크 시간대(오후 6~9시) 배달 시간을 확인하여 플랫폼 성능을 최적화해 보겠습니다. 분 단위의 배달 시간이 담긴 delivery_times 리스트가 준비되어 있습니다.
내장 함수를 활용해 평균 배달 시간을 계산해 봅시다.
이 연습은 강의의 일부입니다
개발자를 위한 Python 중급
연습 안내
- 평균 배달 시간을 구한 후
average_time으로 저장하세요. average_time을 소수점 둘째 자리로 반올림한 후average_rounded로 저장하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
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)