write python program to find sum of even numbers and product of odd numbers in entered list
Answers
Answered by
7
L=eval(input("enter a list of numbers : "))
c=0
d=1
for k in L:
if k%2==0:
c+=k
else:
d*=k
print("Sum of even numbers in ",L," is ",c)
print("Product of odd numbers in ",L," is ",d)
Hope this helps
Similar questions