i=int(input("enter the number")); sum=0; pro=1; while(i>0): d=1%10; if (d%2==0): sum=sum+d; else: pro=pro*d; i=i//10; print("sum=",sum,"product=",pro); code example
Example: i=int(input("enter the number")); sum=0; pro=1; while(i>0): d=1%10; if (d%2==0): sum=sum+d; else: pro=pro*d; i=i//10; print("sum=",sum,"product=",pro);
i=int(input("enter the number"))
add=0
pro=1
while(i>0):
d=1%10
if (d%2==0):
add=add+d
else:
pro=pro*d
i=i//10
print("sum=",add,"product=",pro)