Question: First we will start with a very simple function. The factorial n! is equal to the product of all of the whole numbers from 1

 First we will start with a very simple function. The factorial

First we will start with a very simple function. The factorial n! is equal to the product of all of the whole numbers from 1 up to and including n. For example, 3! - 1'2 3 6. Hint: if you remembered how to add a whole set of numbers in the for-loop recitation, you can mimic that to multiple a whole set of numbers in a range. def fact(n): Compute n! using a simple loop"" answer for i in rangeC How many numbers answer- return answer You can check your code by verifying that 7! evaluates to 5040. NOTE: A later part of this recitation will ask for O!--which should equal 1

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 Databases Questions!