1.

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

Answer»

def factorial(num):

product =1

i = num

while i > 0:

product *=i

i-=l

return product



Discussion

No Comment Found