Question: The factorial function is defined as follows: For a positive integer n , n factorial ( written n ! ) is the product

The factorial function is defined as follows: For a positive integer n, n factorial (written "n!") is the product n *(n-1)*(n-2)*...*1. For example, 3! is 3*2*1=6. Write a function called factorial(n) that takes a positive integer n as input and returns n!. To do this, use the range function and for loops

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!