Vidyalelo
Python · all questions

Module in Python
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

189

Questions

8/10

Page

Pick an option on a question to see the right answer and solution.

Which of the following isn't true about main modules?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following Python code?
import turtle
t=turtle.Pen()
t.goto(300,9)
t.position()

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What does os.name contain?

Select an option to see the answer and solution.

Which of the following functions results in an error?

Select an option to see the answer and solution.

What is the purpose of the from __future__ import ... statement in Python?

Select an option to see the answer and solution.

Which of the following cannot be returned by random.randrange(4)?

Select an option to see the answer and solution.

What is returned by math.ceil(3.4)?

Select an option to see the answer and solution.

What will be the output of the following Python code?
import turtle
t=turtle.Pen()
t.right(90)
t.forward(100)
t.heading()

Select an option to see the answer and solution.

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?
tday=datetime.date.today()
print(tday.isoweekday())

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following Python code?
import random
random.choice(2,3,4)

Select an option to see the answer and solution.

How can you uninstall a Python module using pip?

Select an option to see the answer and solution.

What will be the output of the following Python code?
import datetime
d=datetime.date(2016,7,24)
print(d)

Select an option to see the answer and solution.

How can you create your own module in Python?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which of the following is equivalent to random.randrange(3)?

Select an option to see the answer and solution.

Which of the following will never be displayed on executing print(random.choice({0: 1, 2: 3}))?

Select an option to see the answer and solution.