Is the output of the function abs() the same as that of the function math.fabs()?

Is the output of the function abs() the same as that of the function math.fabs()?
A. sometimes
B. always
C. never
D. none of the mentioned
 
Answer: a
Explanation: math.fabs() always returns a float and does not work with complex numbers whereas the return type of abs() is determined by the type of value that is passed to it.
 

Tìm kiếm

Back
Top