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

2/10

Page

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

Lambda functions cannot be pickled because:

Select an option to see the answer and solution.

Which of the following will not be returned by random.choice("1 ,")?

Select an option to see the answer and solution.

What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?
tday=datetime.date.today()
print(tday.weekday())

Select an option to see the answer and solution.

What will be the output of the following Python code?
import time
time.asctime()

Select an option to see the answer and solution.

Which of the following is not an advantage of using modules?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

The function used to alter the thickness of the pen to 'x' units:

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(50,60)
t1=t.clone()
t1.ycor()

Select an option to see the answer and solution.

Which of the following functions raises an error when an unpicklable object is encountered by Pickler?

Select an option to see the answer and solution.

The number of lines drawn in each case, assuming that the turtle module has been imported:
Case 1:
for i in range(0,10):
	turtle.forward(100)
	turtle.left(90)
Case 2:
for i in range(1,10):
	turtle.forward(100)
	turtle.left(90)

Select an option to see the answer and solution.

What does os.getlogin() return?

Select an option to see the answer and solution.

Which of the following can be used to create a symbolic link?

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

Select an option to see the answer and solution.

The process of pickling in Python includes:

Select an option to see the answer and solution.

In top-down design every module is broken into same number of submodules.

Select an option to see the answer and solution.

What is the value returned by math.floor(3.4)?

Select an option to see the answer and solution.

To obtain a list of all the functions defined under sys module, which of the following functions can be used?

Select an option to see the answer and solution.

What will be the output of the following Python function if the random module has already been imported?
random.randint(3.5,7)

Select an option to see the answer and solution.

Is the output of the function abs() the same as that of the function math.fabs()?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.