Create a function factorial(x) that takes an integer and returns the product of all the positive integers less than or equal to n.

8 views

1 Answers

def factorial(num):

product =1

i = num

while i > 0:

product *=i

i-=l

return product

8 views