Computer Science, asked by arryatitude, 5 months ago

Sample Input: Enter a number 123
1+2+3= 1*2*3
Sample Output: It is a sum-Product number.​

Answers

Answered by jai696
1

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

import math

def sum_prod_num(num):

digits = [int(n) for n in str(num)]

if sum(digits) == math.prod(digits):

return "It is a sum-Product number"

return "It is not a sum-Product number"

n = int(input("enter num: "))

print(sum_prod_num(n))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions