Advertisement
KaeruCT

Untitled

Mar 5th, 2011
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. #!usr/bin/python
  2.  
  3. n = int(input("Digite un numero: "))
  4. fact = 1
  5.  
  6. if n<0:
  7.     print("Numero debe ser positivo.")
  8. else:
  9.     while n>1:
  10.         fact = fact*n
  11.         n -= 1
  12.     print("Factorial del numero es: ", fact)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement