1.

Create a function doubleFactorial(n) that takes an odd integer and returns the product of all odd values upto the value n (where n=2k-l).

Answer»

def doubleFactorial(num):

product = 1

i = 0

k = 0

while k <num:

k = 2*i+l

product * = k

i += 1

return product



Discussion

No Comment Found