Skip to content

Instantly share code, notes, and snippets.

@hector117
Created March 30, 2017 20:51
Show Gist options
  • Save hector117/36a6056868df9b18da0cd48a0b084ab7 to your computer and use it in GitHub Desktop.
Save hector117/36a6056868df9b18da0cd48a0b084ab7 to your computer and use it in GitHub Desktop.
def factorial(x):
a = x
while a > 1:
a = a - 1
x = x * a
return x
#main program below
print("Problema 3 (Examen)")
x = int(input("Ingresa un número"))
b = factorial(x)
print(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment