list1 = []
list2 = []
for i in range(10):
n = int(input('Enter number here: '))
if n % 2 == 0:
list1.append(n)
else:
list2.append(n)
print('Even numbers = {}, odd numbers = {}'.format(len(list1), len(list2)))
Enter number here: 2
Enter number here: 6
Enter number here: 8
Enter number here: 3
Enter number here: 9
Enter number here: 2
Enter number here: 6
Enter number here: 4
Enter number here: 3
Enter number here: 7
Even numbers = 6, odd numbers = 4
Comments
Leave a comment