Write a Python code of a program that asks the user to enter ten numbers then display
the total and the average of ONLY the even numbers among those ten numbers.
Expert's answer
from functools import reduce
N = list(map(int,input().split()))
def fun(x):
if x % 2 == 0:
return x;
even_numbers = list(filter(fun,N))
sum_num = reduce(lambda x,y:x+y,even_numbers)
print(sum_num,sum_num/len(even_numbers))
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot