array = [1,2,5,8,1]
my_dict = {}
for i in array:
if i in my_dict:
my_dict[i] += 1
return True
else:
my_dict[i] = 1
return False
#ошибка
File "main.py", line 8
return True
^
SyntaxError: 'return' outside function