Write function avg which calculates average of numbers in given list.
Python:
- Due to rounding issues please do not use
statistics.mean
or such. - If the array is empty, return 0.
Examples
number([]) # => []
number(["a", "b", "c"]) # => ["1: a", "2: b", "3: c"]
# create an array called websites that has "codewars" as its only value
def find_average(array):
return sum(array) // len(array)