Ответ:
--- Python 3.8.3 ---
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():
MarksList = ReadSeqWhile(int, lambda m: (m <= 5) and (m > 0) )
fives = filter(lambda m: m == 5, MarksList)
print(len(list(fives)))
if __name__ == "__main__":
main()
Объяснение: