Python interview questions part 32

Python interview questions part 32

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. What does the function math.frexp(x) return?

Correct Answer is : a tuple containing of the mantissa and the exponent of x

2. What is the result of math.fsum([.1 for i in range(20)])?

Correct Answer is : 2

3. What is the result of sum([.1 for i in range(20)])?

Correct Answer is : 2

4. What is returned by math.isfinite(float(‘inf’))?

Correct Answer is : FALSE

5. What is returned by math.isfinite(float(‘nan’))?

Correct Answer is : FALSE

6. What is x if x = math.isfinite(float(‘0.0’))?

Correct Answer is : TRUE

7. What is the result of the following? >>> -float('inf') + float('inf')

Correct Answer is :

8. What is the output of the following? print(math.isinf(float('-inf')))

Correct Answer is : TRUE

9. What is the value of x if x = math.ldexp(0.5, 1)?

Correct Answer is : none of the mentioned

10. What is returned by math.modf(1.0)?

Correct Answer is : (0.0, 1.0)

11. What is the result of math.trunc(3.1)?

Correct Answer is : 3

12. What is the output of print(math.trunc(‘3.1’))?

Correct Answer is : error

13. Which of the following is the same as math.exp(p)?

Correct Answer is : math.e ** p

14. What is returned by math.expm1(p)?

Correct Answer is : (math.e ** p) – 1

15. What is the default base used when math.log(x) is found?

Correct Answer is : e

16. Which of the following aren’t defined in the math module?

Correct Answer is : logx()

17. What is returned by int(math.pow(3, 2))?

Correct Answer is : 9

18. What is output of print(math.pow(3, 2))?

Correct Answer is : 9

19. What is the value of x if x = math.sqrt(4)?

Correct Answer is : 2

20. What does math.sqrt(X, Y) do?

Correct Answer is : error

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon