Computer Science
What will be the output of the function given below?
>>import math
>>abs(math.sqrt(25))
- Error
- 5
- -5
- 5.0
Python Libraries
2 Likes
Answer
5.0
Reason — The given code calculates the square root of 25 using the math.sqrt()
function from the math
module, resulting in 5.0 since sqrt()
returns a floating-point number. Applying abs()
to a positive number like 5.0 doesn't alter the value, thus the final output remains 5.0.
Answered By
2 Likes
Related Questions
A …………… function allows us to write a single record into each row of a CSV file.
Does the Primary key of a table accept null or duplicate value? Justify.
Identify the Domain name and URL from the following:
http://www.income.in/home.aboutus.html
Which protocol is used to create a connection with a remote machine?