ZeroDivisionError for a list
"Write a function named mean that accepts a list of numbers as a parameter and returns the arithmetic mean (average) of the numbers in the list as a number. For example, if the list passed contains [2.0, 4.5, 6.5, 1.0], your function should return 3.5. If the list is empty, return 0.0. Do not modify the list that is passed in." This is my code which works for any list of numbers except for when the list is blank ([]) it doesn't return zero, i just get a "ZeroDivisionError"... def mean(list): a = list b = sum(a) count = 0 for i in range(len(list)): count += 1 if a == '': average = 0.0 return average average = b / count return average How do I get the code to output 0.0 if a blank list is inputted?