вот.............................
Объяснение:
k=0
i=0
x=int(input())
while x!=0:
if x%3==0 and x%2>0:
k+=1
x=int(input())
i+=1
print(i)
print(k)
import typing
from typing import Callable
def ReadSeqWhile(SeqType, predicate: Callable[[int], bool]):
temp = SeqType(input())
while predicate(temp):
yield temp
temp = SeqType(input())
def main():
RawSequence = ReadSeqWhile(int, lambda x: x != 0)
Selector = lambda item: (item % 3 == 0) and (item % 2 != 0)
FilteredSequence = filter(Selector, RawSequence)
print(f'Число элементов, удовлетворяющих условию: {len( list( FilteredSequence ) )}')
if __name__ == "__main__":
main()