Ad
Code
Diff
  • def prod(numbers):
        if not len(numbers):
            return 0
        return numbers[0] * (prod(numbers[1:]) or 1)
    • def prod(numbers):
    • if numbers == []: return 0
    • product = 1
    • for number in numbers:
    • product *= number
    • return product
    • if not len(numbers):
    • return 0
    • return numbers[0] * (prod(numbers[1:]) or 1)