Advertisement
elcocodrilotito

Factorial

Oct 17th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. #Dise˜nar una funcion que calcule el factorial del un numero
  2. def factorial(a):
  3.     b=a
  4.     if b==0:
  5.         b=1
  6.     for i in range(1, a):
  7.         b=b*i
  8.     return b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement