Answer:
user_input = [int(input()) for i in range(20)]
even = []
odd = []
for i in user_input:
if i%2:
even.append(i)
else:
odd.append(i)
print("odd : ", len(odd), "even : ", len(even))
Step-by-step explanation:
The above code is written in python :
Using a list comprehension we obtain a list of 20 values from the user and store in the variable user_input.
Two empty list are defined, even and odd which is created to store even and odd values.
A for loop is used to evaluate through the numbers in user_input. Even values leave no remainder when Divided by 2 and are appended to the even list while those those leave a raunder are automatically odd values. The elements each list are counted using the len function and are displayed using the print statement.