Series9. An integer N and a set of N integers are given. Output in the same order the numbers of all odd numbers from the given set and the number K of such numbers.

Solution in Python 3:

import random

N = random.randrange(1,10)
print("N = ",N)
K = 0
for i in range(N):
x = random.randrange(1,21)
K += (int(x%2))
print(i," : ",x," : odd - ",bool(x%2)," : ",K)
print()
print('Amount of odd numbers = ', K)