Разделите ровные и нечетные числа от списка по фильтру в Python
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 45, 89, 63, 74, 85, 96, ]
even = list(filter(lambda x: x % 2 == 0, numbers))
ec = len(even)
print("Even numbers:", even)
print("Total even numbers =", ec)
odd = list(filter(lambda x: x % 2 != 0, numbers))
oc = len(odd)
print("Odd numbers:", odd)
print("Total odd numbers =", oc)
Excited Earthworm