0): d=1%10; if (d%2==0): sum=sum+d; else: pro=pro*d; i=i//10; print("sum=",sum,"product=",pro); You can study and learn programming as you wish in the content of this website. ">
 

Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+4 =