What will be the output of the following Python function?
import math
abs(math.sqrt(25))
import math
abs(math.sqrt(25))A. Error
B. -5
C. 5
D. 5.0
Answer: Option C
Solution (By Examveda Team)
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.

Join The Discussion