n, p = int(input()), 1
while n:
digit = n % 10
if digit % 2 == 0:
p *= digit
n //= 10
print(p)
inp = list(map(int,filter(lambda m: int(m)%2==0,input())))
print(1 if len(inp) == 0 else __import__("math").prod(inp))
p=1
for i in input('n= '):
if i in ('02468'):
p *=int(i)
print(p)
Используй цикл while.
пример
ввод вывод
24 8