Skip to content

Instantly share code, notes, and snippets.

@ThomazPom
Created January 2, 2020 21:17
Show Gist options
  • Save ThomazPom/93b7fd6444fa83ef581da7e76010e97a to your computer and use it in GitHub Desktop.
Save ThomazPom/93b7fd6444fa83ef581da7e76010e97a to your computer and use it in GitHub Desktop.
# Multiply elems in a list
def m(l,i=0,v=1):
return m(l,i+1,v*l[i]) if i+1<len(l) else v*l[i]
# >>> m([1,2,3,4,5])
# 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment