Codewars - Python - Calculate Average

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

For people that are getting ZeroDivisionError, to fix this you need to make sure the code runs through the possiblity of the array being empty so for example:

def find_average(array):

if array == [ ]:
return 0

return sum(array) / len(array)


everything else should be like in the video, you want the small snippet of code that I wrote here at the top of the code, after you define the function

e-kroz
Автор

Hi I am having a problem with this code where it brought up the error that said ZeroDivisionError.

lily_tigerreads
join shbcf.ru