Write a python program to accept a number from user and calculate the sum of even digit and multiplication of Odd Digit |EasyCoding
Write a python program to accept a number from user and calculate the sum of even digit and multiplication of Odd Digit.
Example :-
Number = 12345
multiplication=1*3*5
sum=2+4
odd = multiplication and even = Addition
Program :- (Write a python program to accept a number from user and calculate the sum of even digit and multiplication of Odd Digit )
number =int(input("Enter Number :"))
temp=number
mul=1
sum=0
while(number!=0):
rem=number%10
if(rem%2==0):
sum=sum+rem
else:
mul=mul*rem
number=int(number/10)
print("sum is ",sum)
print("multiplication is ",mul)
Output :-
Please Comment if You have any doubt 👇👇
Comments
Post a Comment