Question 1 of 25
Hints left: 3
Q1
Which module in the python standard library parses options received from the command line?
Q2
What will be the output of the following Python program? z=set('abc') z.add('san') z.update(set(['p', 'q'])) z
-
A
-
B
-
C
-
D
Q3
What arithmetic operators cannot be used with strings in Python?
Q4
What will be the output of the following Python code? print("abc. DEF".capitalize())
Q5
What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc', 'def'] print(id(q) == foo(q))
Q6
The process of pickling in Python includes . . . . . . . .
Q7
What is output of print(math.pow(3, 2))?
Q8
What will be the value of 'result' in following Python program? list1 = [1,2,3,4] list2 = [2,4,5,6] list3 = [2,6,7,8] result = list() result.extend(i for i in list1 if i not in (list2+list3) and i not in result) result.extend(i for i in list2 if i not in (list1+list3) and i not in result) result.extend(i for i in list3 if i not in (list1+list2) and i not in result)
-
A
-
B
-
C
-
D
Q9
What will be the output of the following Python code snippet? for i in [1, 2, 3, 4][::-1]: print (i)
Q10
What will be the output of the following Python statement? >>>"a"+"bc"
Q11
What is the maximum possible length of an identifier in Python?
Q12
What will be the output of the following Python expression if x=56.236? print("%.2f"%x)
Q13
Which of the following statements is used to create an empty set in Python?
Q14
What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)
Q15
What will be the output of the following Python code? l=[1, 0, 2, 0, 'hello', '', []] list(filter(bool, l))
-
A
-
B
-
C
-
D
Q16
What will be the output of the following Python code? x = 'abcd' for i in range(len(x)): print(i)
Q17
What will be the output of the following Python code? i = 1 while True: if i%3 == 0: break print(i) i + = 1
Q18
Which of the following is a Python tuple?
Q19
Which function is called when the following Python program is executed? f = foo() format(f)
Q20
Which of the following is a feature of Python DocString?
Q21
What will be the output of the following Python program? def addItem(listParam): listParam += [1] mylist = [1, 2, 3, 4] addItem(mylist) print(len(mylist))
Q22
What are the two main types of functions in Python?
Q23
What will be the output of the following Python code snippet? z=set('abc$de') 'a' in z
Q24
What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='')
Q25
Which of the following is the truncation division operator in Python?