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