Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
Using python 3, design a function a function count_less_than_average(x): that returns the number of elements in x that are (strictly) less than the...
Using python 3, design a function a function count_less_than_average(x): that returns the number of elements in x that are (strictly) less than the average of x.
For example:
- If x = [1, 2, 3, 4, 5], count_less_than_average(x) should return 2, since the average of x is 3 and there
- are two elements in x less than 3.
- If x = (1, 2, 3, 4, 100), count_less_than_average(x) should return 4, since the average of x is 22 and
- there are four elements in x less than 22.
- If x = [], count_less_than_average(x) should return 0 since the average of an empty sequence is undefined.