JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Python interview questions part 32
Python interview questions part 32
Back
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?
A. a tuple containing of the mantissa and the exponent of x
B. a list containing of the mantissa and the exponent of x
C. a tuple containing of the mantissa of x
D. a list containing of the exponent of x
Show Correct Answer
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)])?
A. 2
B. 20
C. 2
D. 2
Show Correct Answer
Correct Answer is :
2
3. What is the result of sum([.1 for i in range(20)])?
A. 2
B. 20
C. 2
D. 2
Show Correct Answer
Correct Answer is :
2
4. What is returned by math.isfinite(float(‘inf’))?
A. TRUE
B. FALSE
C. None
D. error
Show Correct Answer
Correct Answer is :
FALSE
5. What is returned by math.isfinite(float(‘nan’))?
A. TRUE
B. FALSE
C. None
D. error
Show Correct Answer
Correct Answer is :
FALSE
6. What is x if x = math.isfinite(float(‘0.0’))?
A. TRUE
B. FALSE
C. None
D. error
Show Correct Answer
Correct Answer is :
TRUE
7. What is the result of the following? >>> -float('inf') + float('inf')
A. inf
B.
C. 0
D. 0
Show Correct Answer
Correct Answer is :
8. What is the output of the following? print(math.isinf(float('-inf')))
A. error, the minus sign shouldn’t have been inside the brackets
B. error, there is no function called isinf
C. TRUE
D. FALSE
Show Correct Answer
Correct Answer is :
TRUE
9. What is the value of x if x = math.ldexp(0.5, 1)?
A. 1
B. 2
C. 0.5
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
10. What is returned by math.modf(1.0)?
A. (0.0, 1.0)
B. (1.0, 0.0)
C. (0.5, 1)
D. (0.5, 1.0)
Show Correct Answer
Correct Answer is :
(0.0, 1.0)
11. What is the result of math.trunc(3.1)?
A. 3
B. 3
C. 0.1
D. 1
Show Correct Answer
Correct Answer is :
3
12. What is the output of print(math.trunc(‘3.1’))?
A. 3
B. 3
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
13. Which of the following is the same as math.exp(p)?
A. e ** p
B. math.e ** p
C. p ** e
D. p ** math.e
Show Correct Answer
Correct Answer is :
math.e ** p
14. What is returned by math.expm1(p)?
A. (math.e ** p) – 1
B. math.e ** (p – 1)
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
(math.e ** p) – 1
15. What is the default base used when math.log(x) is found?
A. e
B. 10
C. 2
D. none of the mentioned
Show Correct Answer
Correct Answer is :
e
16. Which of the following aren’t defined in the math module?
A. log2()
B. log10()
C. logx()
D. none of the mentioned
Show Correct Answer
Correct Answer is :
logx()
17. What is returned by int(math.pow(3, 2))?
A. 6
B. 9
C. error, third argument required
D. error, too many arguments
Show Correct Answer
Correct Answer is :
9
18. What is output of print(math.pow(3, 2))?
A. 9
B. 9
C. None
D. none of the mentioned
Show Correct Answer
Correct Answer is :
9
19. What is the value of x if x = math.sqrt(4)?
A. 2
B. 2
C. (2, -2)
D. (2.0, -2.0)
Show Correct Answer
Correct Answer is :
2
20. What does math.sqrt(X, Y) do?
A. calculate the Xth root of Y
B. calculate the Yth root of X
C. error
D. return a tuple with the square root of X and Y
Show Correct Answer
Correct Answer is :
error
Similar Interview Questions
Search for latest jobs
Find Jobs