Skip to content

Commit 2cc4d46

Browse files
authored
Create split_number
1 parent 473d91c commit 2cc4d46

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

split_number

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def checkio(number):
2+
3+
sum = 1
4+
zz = map(int,str(number))
5+
for x in zz:
6+
if x != 0:
7+
sum *=x
8+
return sum
9+
10+
#These "asserts" using only for self-checking and not necessary for auto-testing
11+
if __name__ == '__main__':
12+
assert checkio(123405) == 120
13+
assert checkio(999) == 729
14+
assert checkio(1000) == 1
15+
assert checkio(1111) == 1

0 commit comments

Comments
 (0)