print('Введите числа... Для окончания ввода, напишите 0')
lst = []
enter = []
while True:
enter = list(map(int, input().split(', ')))
if len(enter) == 1 and 0 in enter:
break
lst.append(enter)
def find_even(lst):
even = 0
result = 0
rt = []
for external in lst:
for elem in external:
if elem % 2 == 0:
even += 1
if even > result:
result = even
rt = external
return rt
print(*find_even(lst))
Объяснение:
print('Введите числа... Для окончания ввода, напишите 0')
lst = []
enter = []
while True:
enter = list(map(int, input().split(', ')))
if len(enter) == 1 and 0 in enter:
break
lst.append(enter)
enter = []
def find_even(lst):
even = 0
result = 0
rt = []
for external in lst:
for elem in external:
if elem % 2 == 0:
even += 1
if even > result:
result = even
rt = external
even = 0
return rt
print(*find_even(lst))
Объяснение: