CBSE Class 11 Computer Science Question 8 of 63

Introduction to Python Modules — Question 8

Back to all questions
8
Question

Question 8

Assertion (A): The output of print(math.factorial(4.5)) shall generate an error.

Reasoning (R): This factorial() function belongs to the statistics module in Python.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

A is true but R is false.

Explanation
The math.factorial() function in Python requires an integer argument, so using 4.5 as an argument will generate an error. The factorial() function belongs to the math module.