Computer Science

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.

Python Modules

3 Likes

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.

Answered By

2 Likes


Related Questions