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