DEV Community

Discussion on: Daily Coding Puzzles - Nov 4th - Nov 9th

Collapse
 
aspittel profile image
Ali Spittel

Python!

def product(numbers):
    if not numbers: return None
    running_product = 1
    for number in numbers:
        running_product *= number
    return running_product
Collapse
 
marcellothearcane profile image
marcellothearcane
def product (numbers):
  return reduce(lambda total, number: total * number, numbers)