Home / Expert Answers / Computer Science / what-will-be-the-output-of-the-following-code-import-functoolsimport-operatordef-factorial-n-34-34-3-pa757

(Solved): What will be the output of the following code?import functoolsimport operatordef factorial(n):""" Fa ...



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



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe