Examveda

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

A. Returns the absolute value of a number

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 (By Examveda Team)

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.

This Question Belongs to Python Program >> Python Built In Functions

Join The Discussion

Related Questions on Python Built In Functions