1.

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 mentionedThis question was addressed to me in an online quiz.My question is based upon Math topic in portion Mapping Functions and Modules of Python

Answer»

Right option is (a) sometimes

Easy 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.



Discussion

No Comment Found

Related InterviewSolutions