CS Bridge Course
CS Bridge Course
3.
4.
11.
12.
a)
b)
c)
d)
13.
14.
15.
1.
2.
3.
4.
5.
11.
12.
e)
f)
g)
h)
13.
14.
15.
6.
7.
8.
6-
1- What will be printed by the following code when it executes?
1. Which of the following is a Python tuple?
i. [1, 2, 3] ii. (1, 2, 3) iii. {1, 2, 3} iv. { }
2. Jyoti wants to add a new tuple t2 to the tuple t1, which statement she should use-
i. sum(t1,t2) ii. T1.add(t2) iii. t1+t2 iv. None of these
6. To display the last element of the tuple, which statement should be used-
i>>> t.display() ii>>>t.pop() iii>>>t[-1] iv>>>t.last()
2. Jyoti wants to add a new tuple t2 to the tuple t1, which statement she should use-
i. sum(t1,t2) ii. T1.add(t2) iii. t1+t2 iv. None of these
3. Which of the following is correct to insert a single element in a tuple-
i. T=4 ii. T=(4) iii. T(4,) iv. T=[4,]
5.
i. Homogenous ii. Heterogenous iii. both i & ii iv. None of these
7. Rajat wants to delete all the elements from the tuple, which statement he should use to perform this
operation-
i t.clear() ii. del t iii. t.remove() iv. None of these
8. To display the last element of the tuple, which statement should be used-
i>>> t.display() ii>>>t.pop() iii>>>t[-1] iv>>>t.last()
9. Shreya wants to add a new tuple t2 to the tuple t1, which statement she should use
i. sum (t1,t2) ii. t2.add(t1) iii. t1+t2 iv. None of these
10. Which of the following operations is not valid for tuples in Python?
i. Concatenation ii. Indexing iii. Appending iv. Slicing
Answer: 1- ii, 2-iii, 3-iii, 4-ii, 5-iii, 6-i, 7- iv, 8-iii, 9-iii, 10-iii