Created
March 30, 2017 20:51
-
-
Save hector117/36a6056868df9b18da0cd48a0b084ab7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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