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

6/10

Page

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

What is returned by math.expm1(p)?

Select an option to see the answer and solution.

What is math.factorial(4.0)?

Select an option to see the answer and solution.

Both the functions randint and uniform accept . . . . . . . . parameters.

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following Python code?
random.seed(3)
random.randint(1,5)
2
random.seed(3)
random.randint(1,5)

Select an option to see the answer and solution.

The command which helps us to reset the pen (turtle):

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following code:
from math import ceil
print(ceil(4.3))

Select an option to see the answer and solution.

Which of the following cannot be pickled?

Select an option to see the answer and solution.

What will be the output of the following Python code?
import sys
sys.argv[0]

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,4):
	t.forward(100)
	t.left(90)
 
t.penup()
t.left(90)
t.forward(200)
for i in range(0,4):
	t.forward(100)
	t.left(90)

Select an option to see the answer and solution.

Which of the following is the same as math.exp(p)?

Select an option to see the answer and solution.

The output of the following Python code will result in a shape similar to the alphabet . . . . . . . .
import turtle
t=turtle.Turtle()
t1=turtle.Turtle()
t.left(45)
t1.left(135)
t.forward(100)
t1.forward(100)

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)?
import datetime
tday=datetime.date.today()
print(tday)

Select an option to see the answer and solution.

What will be the output of the following Python code?
import time
for i in range(0,5):
	print(i)
	time.sleep(2)

Select an option to see the answer and solution.

What does the dir() function in Python do?

Select an option to see the answer and solution.

What will be the output of the following Python code?
import time
t=(2010, 9, 20, 8, 15, 12, 6)
time.asctime(t)

Select an option to see the answer and solution.

What does math.sqrt(X, Y) do?

Select an option to see the answer and solution.

How can you create a Python package?

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.forward(100)
t.left(90)
t.clear()
t.position()

Select an option to see the answer and solution.