print(sum(my_list) / len(my_list) if len(my_list) > 0 else "ошибка")
'Нельзя так'
class first_is_0 (Exception):
pass
try:
l = [int(input())]
if l[0] == 0:
raise first_is_0('Нельзя так')
while True:
n = int(input())
l += [n]
if not n:
break
print(sum(l) / len(l))
except first_is_0 as e:
print(f'ошибка {e}')
print(sum(my_list) / len(my_list) if len(my_list) > 0 else "ошибка")
class first_is_0 (Exception):
pass
try:
l = [int(input())]
if l[0] == 0:
raise first_is_0('Нельзя так')
while True:
n = int(input())
l += [n]
if not n:
break
print(sum(l) / len(l))
except first_is_0 as e:
print(f'ошибка {e}')