Секція 1. Розділ 4
single
Challenge: Calculate and Print Averages
Свайпніть щоб показати меню
Завдання
Проведіть, щоб почати кодувати
Write a function that calculates and prints the average of a given list of numbers.
- Calculate the sum of all numbers in the
numberslist. - Determine the number of elements in the
numberslist. - If the list is empty, set the average to 0.
- Otherwise, divide the sum by the number of elements to get the average.
- Print a message displaying the calculated average.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 4
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат