Write a Python program that counts the number of even and odd numbers in a list.
[2, 7, 3, 8, 12]
def count_odd_even(lst):
 even_count = 0
 odd_count = 0
 for num in lst:
 if num % 2 == 0:
 even_count += 1
 else:
 odd_count += 1
 return [even_count, odd_count]