Question: What will be the output of the following code?import functoolsimport operatordef factorial ( n ) : Factorial of a number. > >

What will be the output of the following code?import functoolsimport operatordef factorial(n):""" Factorial of a number.>>> factorial(0)1>>> factorial(1)1>>> factorial(5)120>>> factorial(10)3628800"""return functools.reduce(operator.mul, range(1, n+1))if __name__=="__main__":import doctestdoctest.testmod(verbose=True)This type of question contains radio buttons and checkboxes for selection of options. Use Tab for navigation and Enter or space to select the option.optionA2 items had failures: 2 of 4 in __main__.factorialoptionB1 items had failures: 1 of 4 in __main__.factorialoptionC4 passed and 0 failedoptionDError on line 2

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!