Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code? import datetime d=datetime.date(2016,7,24) print(d)
Q2
What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)? import turtle t=turtle.Pen() t.goto(100,0) t.towards(0,0)
Q3
What will be the output of the following Python code? import turtle t=turtle.Pen() t.backward(100) t.penup() t.right(45) t.isdown()
Q4
Which of the following functions can be used to read data from a file using a file descriptor?
Q5
What is the result of math.trunc(3.1)?
Q6
Which of the following will never be displayed on executing print(random.choice({0: 1, 2: 3}))?
Q7
Fill in the blank such that the following Python code results in the formation of an inverted, equilateral triangle. import turtle t=turtle.Pen() for i in range(0,3): t.forward(150) t.right(_____)
Q8
Which of the following is true about top-down design process?
Q9
What will be the output of the following Python code? import time time.time()
Q10
What will be the output of the following Python code? import random random.choice(2,3,4)
Q11
How can you create your own module in Python?
Q12
What will be the output of the following Python code? import turtle t=turtle.Pen() t.color(0,0,1) t.begin_fill() t.circle(15) t.end_fill()
Q13
What will be the output of the following Python code? #mod1 def change(a): b=[x*2 for x in a] print(b) #mod2 def change(a): b=[x*x for x in a] print(b) from mod1 import change from mod2 import change #main s=[1,2,3] change(s)
Q14
What is the value of x if x = math.factorial(0)?
Q15
How can you uninstall a Python module using pip?
Q16
The function random.randint(4) can return only one of the following values. Which?
Q17
What is x if x = math.isfinite(float('0.0'))?
Q18
The copy module uses the . . . . . . . . protocol for shallow and deep copy.
Q19
Point out the error (if any) in the code shown below if the system date is 18th June, 2017? tday=datetime.date.today() bday=datetime.date(2017,9,18) till_bday=bday-tday print(till_bday)
Q20
Which of the following is equivalent to random.randrange(3)?
Q21
What will be the output of the following Python code if the system date is 18th August, 2016? tday=datetime.date.today() print(tday.month())
Q22
Which of the following functions is not defined under the sys module?
Q23
What will be the output of print(math.factorial(4.5))?
Q24
What will be the output of the following Python code? import sys sys.stderr.write(“hello”)
Q25
What will be the output of the following Python code? import sys sys.stdin.readline() Examveda