Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code? import sys sys.argv[0]
Q2
In which direction is the turtle pointed by default?
Q3
What is the result of sum([.1 for i in range(20)])?
Q4
Which of the following cannot be pickled?
Q5
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)
Q6
Which of the following is the same as math.exp(p)?
Q7
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)
Q8
Both the functions randint and uniform accept . . . . . . . . parameters.
Q9
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)
Q10
What is displayed on executing print(math.fabs(-3.4))?
Q11
What is the purpose of the __file__ attribute in a Python module?
Q12
What will be the output of the following Python code? import time t=(2010, 9, 20, 8, 15, 12, 6) time.asctime(t)
Q13
What will be the output of the following Python function (random module has already been imported)? random.choice('sun')
Q14
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)
Q15
What does math.sqrt(X, Y) do?
Q16
The command which helps us to reset the pen (turtle):
Q17
What will be the output of the following Python code? import time for i in range(0,5): print(i) time.sleep(2)
-
A
-
B
-
C
-
D
Q18
What will be the output of the following code: from math import ceil print(ceil(4.3))
Q19
What does the dir() function in Python do?
Q20
How can you create a Python package?
Q21
If __getstate__() returns _______________ the __setstate__() module will not be called on pickling.
Q22
Which of the following returns a string that represents the present working directory?
Q23
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()
Q24
The output of the following two Python codes is exactly the same. object 'a' CODE 1 >>> pickle.dumps('a', 3) CODE 2 >>> pickle.dumps(object, 3)
Q25
Which of the following is not a valid namespace?