Integer11. A three-digit number is given. Find the sum and product of its digits.

Solution in Python 3:

import random

N = random.randrange(100,1000)
print("Number: ", N)
d2 = int(N/100)
d1 = int((N-d2*100)/10)
d0 = N%10
print("Hundreds: ", d2)
print("Tens: ", d1)
print("Units: ", d0)
print("Sum of the digits: ", d0+d1+d2)
print("Product of the digits: ", d0*d1*d2)