Skip to content

Instantly share code, notes, and snippets.

@biazzotto
Last active May 17, 2020 16:18
Show Gist options
  • Save biazzotto/1b4c4c0b4c8883aa1a1a5f35a969aee7 to your computer and use it in GitHub Desktop.
Save biazzotto/1b4c4c0b4c8883aa1a1a5f35a969aee7 to your computer and use it in GitHub Desktop.
Formas de função fatorial em lamba
fatorial = lambda x: (x<=1 and 1) or fatorial(x-1)*x
fatorial = lambda x: 1 if x<=1 else fatorial(x-1)*x
fatorial = lambda x: int(x<=1) or fatorial(x-1)*x
fatorial = lambda x: fatorial(x-1)*x if x>1 else 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment