gs gs109 Python Modules - Python Math - Quiz No.2
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Modules. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What does the function math.frexp(x) return?
a tuple containing the mantissa and the exponent of x
a list containing the mantissa and the exponent of x
a tuple containing the mantissa of x
a list containing the exponent of x
Question 2: What is the result of math.fsum([.1 for i in range(20)])?
2.0
20
2
2.0000000000000004
Question 3: What is the result of sum([.1 for i in range(20)])?
2.0
20
2
2.0000000000000004
Question 4: What is returned by math.isfinite(float(‘inf’))?
True
False
None
error
Question 5: What is returned by math.isfinite(float(‘nan’))?
True
False
None
error
Question 6: What is x if x = math.isfinite(float(‘0.0’))?
True
False
None
error
Question 8: What will be the output of the following Python code?
print(math.isinf(float('-inf')))
error, the minus sign shouldn’t have been inside the brackets
error, there is no function called isinf
True
False
Question 9: What is the value of x if x = math.ldexp(0.5, 1)?
1
2.0
0.5
none of the mentioned
Question 10: What is returned by math.modf(1.0)?
(0.0, 1.0)
(1.0, 0.0)
(0.5, 1)
(0.5, 1.0)