Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingrammer/ec3c036dbaece8c57f6ace08529e5792 to your computer and use it in GitHub Desktop.
Save mingrammer/ec3c036dbaece8c57f6ace08529e5792 to your computer and use it in GitHub Desktop.
from functools import reduce
primes = [2, 3, 5, 7, 11, 13]
def product(*numbers):
p = reduce(lambda x, y: x * y, numbers)
return p
product(*primes)
# 30030
product(primes)
# [2, 3, 5, 7, 11, 13]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment