n = 0
c = 0
while 1:
a = int(input())
if a == 0:
break
elif a % 2 == 0:
n += a
c += 1
print(f"Ср.Арифм.Чёт.Чисел = {n/c}")
from typing import Callable, Iterable, Any
import statistics
def ReadSeqIntegerWhile(predicate: Callable[[Any], bool], promt: str = None):
if (promt != None):
print(promt)
temp = int(input())
while(predicate(temp)):
yield temp
def main():
a = ReadSeqIntegerWhile(lambda p: p != 0, "Enter values:\n")
print(statistics.mean(filter(lambda p: p % 2 == 0, a)))
main()
n = 0
c = 0
while 1:
a = int(input())
if a == 0:
break
elif a % 2 == 0:
n += a
c += 1
print(f"Ср.Арифм.Чёт.Чисел = {n/c}")
from typing import Callable, Iterable, Any
import statistics
def ReadSeqIntegerWhile(predicate: Callable[[Any], bool], promt: str = None):
if (promt != None):
print(promt)
temp = int(input())
while(predicate(temp)):
yield temp
temp = int(input())
def main():
a = ReadSeqIntegerWhile(lambda p: p != 0, "Enter values:\n")
print(statistics.mean(filter(lambda p: p % 2 == 0, a)))
main()