Skip to content

Instantly share code, notes, and snippets.

@jmlon
Created May 14, 2021 14:02
Show Gist options
  • Save jmlon/6c4d787a07304c3909dac7010399c80b to your computer and use it in GitHub Desktop.
Save jmlon/6c4d787a07304c3909dac7010399c80b to your computer and use it in GitHub Desktop.
Factorial recursivo
def factorialRecursivo(n):
assert type(n) is int
if n==0:
return 1
else:
return n*factorialRecursivo(n-1)
n = int(input('Ingrese n: '))
x = factorialRecursivo(n)
print( x, type(x) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment