#542 · Loops · Beginner · 30 XP · about 4 min
The double factorial of n, written n!!, multiplies n by every second number below it, down to 1 or 2:
Write double_factorial(n) that returns n!!. Mathematicians agree that 0!! and 1!! are both 1.
double_factorial(7) # returns 105 double_factorial(8) # returns 384 double_factorial(0) # returns 1
n is a whole number from 0 to 100.
First solves only, ranked by stars and then time.