Multiplicative Digital Root

🎯 Calculate the multiplicative digital root of a number.

The multiplicative digital root is the product of all digits.

number

MDR

7

7

23

6

111

1

100

0

333

27

Hints

  • Which data type is suitable for addressing the digits individually?

  • Because of the commutative law, it doesn’t matter in which order you multiply the numbers.

Extra Challenge

  • for an advanced challenge, look up the functools.reduce function and solve the problem with it.

Translated with www.DeepL.com