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ā€¦ | Cheap Nursing Papers

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.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp