Skip to content

Instantly share code, notes, and snippets.

@marquesds
Created February 22, 2022 01:07
Show Gist options
  • Save marquesds/2496f05063929194d56421f02e26b1cd to your computer and use it in GitHub Desktop.
Save marquesds/2496f05063929194d56421f02e26b1cd to your computer and use it in GitHub Desktop.
Fatorial algorith using reduce function
import functools
import operator
def fat(n):
return functools.reduce(operator.mul, range(1, n + 1), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment