Question: Define a recursive function that takes an integer argument and returns the factorial of that argument. Recall that 3 factorial, written 3!, equals 3
Define a recursive function that takes an integer argument and returns the factorial of that argument. Recall that 3 factorial, written 3!, equals 3 × 2!, and so on, with 0! defined as 1. In general, if n is greater than zero, n! = n * (n - 1)!.Test your function in a program that uses a loop to allow the user to enter various values for which the program reports the factorial.
Step by Step Solution
3.48 Rating (165 Votes )
There are 3 Steps involved in it
def factorialn if n 0 return 1 else return n factorialn1 num intin... View full answer
Get step-by-step solutions from verified subject matter experts
