Passed
Push — master ( a892fa...d1ecba )
by Ken M.
01:03
created

digits_multiplication.checkio()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
from functools import reduce
2
from operator import mul
3
4
5
def checkio(number):
6
    return reduce(mul, map(int, list(str(number).replace('0', ''))))
7
8
9
# These "asserts" using only for self-checking and not necessary for
10
# auto-testing
11
if __name__ == '__main__':
12
    assert checkio(123_405) == 120
13
    assert checkio(999) == 729
14
    assert checkio(1000) == 1
15
    assert checkio(1111) == 1
16