Math In Python: Math MCQs in Python Programming

Math In Python. Multiple Choice Questions related to Mathematical Functions in Python Programming Language.

 

Math In Python

 

 

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

 

What is math.floor(0o10) ??

a) 8
b) 10
c) 0
d) 9

 

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)

 

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

a) 2
b) 2.0
c) (2, -2)
d) (2.0, -2.0)

 

Math In Python

 

What will be the output of print(math.factorial(4.5)) ??

a) 24
b) 120
c) error
d) 24.0

 

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

a) 1
b) 2.0
c) 0.5
d) none of the mentioned

 

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

a) 9
b) 9.0
c) None
d) None of the mentioned

 

What is math.factorial(4.0) ??

a) 24
b) 1
c) error
d) none of the mentioned

 

Math In Python

 

What will be the output ??

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

 

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

a) 6
b) 9
c) error, third argument required
d) error, too many arguments

 

What is the value of x if x = math.factorial(0) ??

a) 0
b) 1
c) error
d) none of the mentioned

 

What will be the output of the code ??

>>> -float(‘inf’) + float(‘inf’)

a) inf

b) nan

c) 0

d) 0.0

 

Math In Python

 

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

a) log2()
b) log10()
c) logx()
d) none of the mentioned

 

What is the value returned by math.fact(6) ??

a) 720
b) 6
c) [1, 2, 3, 6]
d) error

 

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

a) True
b) False
c) None
d) error

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!