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

Join The Discussion