Q: What is the result of math.trunc(3.1)?
Solution: The integral part of the floating point number is returned.
Q: What is the output of print(math.trunc(‘3.1’))?
Solution: TypeError, a string does not have __trunc__ method.
Q: Which of the following is the same as math.exp(p)?
Solution: math.e is the constant defined in the math module.
Q: What is returned by math.expm1(p)?
Solution: One is subtracted from the result of math.exp(p) and returned.
Q: What is the default base used when math.log(x) is found?
Solution: The natural log of x is returned by default.
Q: Which of the following aren’t defined in the math module?
Solution: log2() and log10() are defined in the math module.
Q: What is returned by int(math.pow(3, 2))?
Solution: math.pow(a, b) returns a ** b.
Q: What is output of print(math.pow(3, 2))?
Solution: math.pow() returns a floating point number.
Q: What is the value of x if x = math.sqrt(4)?
Solution: The function returns one floating point number.
Q: What does math.sqrt(X, Y) do?
Solution: The function takes only one argument.
You Have Score    | /10 |