Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursion solution in Clear category for Digits Multiplication by Kolia951
def checkio(numbers: int) -> int:
numbers = str(numbers).replace("0","")
numbers = [int(i) for i in numbers]
def recur_mult(data: str) -> int:
if data == []:
return 1
else:
res = recur_mult(data[1:])
res *= data[0]
return res
return recur_mult(numbers)
print("Example:")
print(checkio(123405))
assert checkio(123405) == 120
assert checkio(999) == 729
assert checkio(1000) == 1
assert checkio(1111) == 1
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 13, 2022