Examveda
Examveda

Which built-in function is used to calculate the absolute value of a number?

A. abs()

B. absolute()

C. val_abs()

D. calculate_abs()

Answer: Option A

Solution(By Examveda Team)

The correct answer is Option A: abs().
The abs() function in Python is used to calculate the absolute value of a number.
It returns the magnitude of a numeric value without regard to its sign.
For example:
print(abs(-5))   # Output: 5
print(abs(3.14)) # Output: 3.14

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

Join The Discussion

Related Questions on Python Built In Functions