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

5/10

Page

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

Program code making use of a given module is called a . . . . . . . . of the module.

Select an option to see the answer and solution.

Pick the correct statement regarding pickle and marshal modules.

Select an option to see the answer and solution.

How can you access a variable my_variable from a module my_module in Python?

Select an option to see the answer and solution.

What will be the output of the following Python code, if the time module has already been imported?
def num(m):
	t1 = time.time()
	for i in range(0,m):
		print(i)
	t2 = time.time()
	print(str(t2-t1))
 
    num(3)

Select an option to see the answer and solution.

What does os.fchmod(fd, mode) do?

Select an option to see the answer and solution.

What will be the output of the following Python code?
>>> -float('inf') + float('inf')

Select an option to see the answer and solution.

What will be the output shape of the following Python code?
import turtle
t=turtle.Pen()
for i in range(1,4):
	t.forward(60)
	t.left(90)

Select an option to see the answer and solution.

The value returned when we use the function isoweekday() is . . . . . . . . and that for the function weekday() is . . . . . . . . if the system date is 19th June, 2017 (Monday).

Select an option to see the answer and solution.

What will be the output of print(math.copysign(3, -1))?

Select an option to see the answer and solution.

The randrange function returns only an integer value.

Select an option to see the answer and solution.

What will be the output of the following Python code?
import turtle
t=turtle.Pen()
for i in range(0,5):
        t.left(144)
        t.forward(100)

Select an option to see the answer and solution.

To sterilize an object hierarchy, the . . . . . . . . function must be called. To desterilize a data stream, the . . . . . . . . function must be called.

Select an option to see the answer and solution.

What will be the output shape of the following Python code?
import turtle
t=turtle.Pen()
for i in range(0,6):
	t.forward(100)
	t.left(60)

Select an option to see the answer and solution.

What is the purpose of the __doc__ attribute in a Python module?

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.color(1,1,1)
t.begin_fill()
for i in range(0,3):
	t.forward(100)
	t.right(120)
              t.end_fill()

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.tilt(75)
t.forward(100)

Select an option to see the answer and solution.

All modular designs are because of a top-down design process.

Select an option to see the answer and solution.

What is the purpose of the __name__ variable in a Python module?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following Python code?
pickle.HIGHEST_PROTOCOL

Select an option to see the answer and solution.