Statistics2 Get the mean of an array Description: It's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script. Return the average of the given array rounded down to its nearest integer. The array will never be empty. Solution: 1. Find the average. 2. Rounds down to an inte.. 2022. 4. 15. Calculate average Description: Write a function which calculates the average of the numbers in a given list. Note: Empty arrays should return 0. Solution: 1. If 'numbers' is an empty array, 0 is returned. 2. If it is not empty, the average value is returned. import statistics def find_average(numbers): return statistics.mean(numbers) if numbers else 0 statistics.mean() is a Python built-in library that calculates.. 2022. 4. 7. 이전 1 다음