#sample solution
def factorial(x):
x = abs(x) #prevents error on negative numbers
product = 1
for i in range(x):
product = product * (i+1)
return product
print factorial(10)
def factorial(x):
x = abs(x) #prevents error on negative numbers
product = 1
for i in range(x):
product = product * (i+1)
return product
print factorial(10)
No comments:
Post a Comment