Vidyalelo
Python · Q52

Python Built

Programming · Python · question 52

Q52

What is the purpose of the built-in function abs()?

A.
Returns the absolute value of a number
Answer
B.
Converts a string to lowercase
C.
Rounds a floating-point number to the nearest integer
D.
Returns the sum of two numbers

Answer: Option A

Solution

Answer: Option A
Solution:
The abs() function in Python returns the absolute value of a number, which is the distance of the number from zero on the number line, regardless of its sign.