Vidyalelo
Python · Q46

Python Built

Programming · Python · question 46

Q46

What will be the output of the following Python function? import math abs(math.sqrt(25))

A.
Error
B.
-5
C.
5
Answer
D.
5.0

Answer: Option C

Solution

Answer: Option C
Solution:
The correct answer is Option C: 5. Here's why:

The math.sqrt() function returns the square root of a given number.
In this case, math.sqrt(25) returns the square root of 25, which is 5.
Then, the abs() function returns the absolute value of the result, which is 5.
Therefore, the output of the code abs(math.sqrt(25)) is 5.

So, the correct choice is Option C: 5.