Multiple Choice Question For Tuple Class 11 Computer Science (CS)
1. Which of the following statements will create a tuple ?
(a) tp1 = ("a", "b")
(b) tp1[2] = ("a", "b")
(c) tp1 = (3)*3
(d) None of these
2. Choose the correct statement(s).
(a) Both tuples and lists are immutable.
(b) Tuples are immutable while lists are mutable.
(c) Both tuples and lists are mutable.
(d) Tuples are mutable while lists are immutable.
3. Choose the correct statement(s).
(a) In Python, a tuple can contain only integers as its elements,
(b) In Python, a tuple can contain only strings as its elements.
(c) In Python, a tuple can contain elements of different types.
(d) In Python, a tuple can contain either string or integer but not both at a time.
4. Which of the following is/are correctly declared tuple(s)?
(a) a = ("Hina", "Mina", "Tina", "Nina")
(b) a = "Hina", "Mina", "Tina", "Nina")
(c) a = ["Hina", "Mina", "Tina", "Nina"]
(d) a =(["Hina", "Mina", "Tina", "Nina"])
5. Which of the following will create element tuple ?
(a) (1,)
(b) (1)
(c) ([1])
(d) tuple([1]).
6. What will be the output of following Python code ?
tp1 = (2,4,3)
tp3 = tp1*2
print(tp3)
(a) (4.8,6)
(b) (2,4,3,2,4,3)
(c) (2,2,4,4,3,3)
(d) Error
7. What will be the output of following Python code?
tp1 = (15,11,17,16,12)
tpl.pop(12)
print (tp1)
(a) (15,11,16,12)
(b) (15,11,17,16)
(c) (15,11,17,16,12)
(d) Error
8. Which of the following options will not result in an error when performed on types in Python where tp = (5, 2, 7, 0, 3) ?
(a) tp [1] = 2
(b) tp.append(2)
(c) tp1 = tp + tp
(d) tp.sum()
9. What will be the output of the following Python code ?
tp = ( )
tp1 = tp * 2
print (len (tp1))
(a) 0
(b) 2
(c) 1
(d) Error
10. What will be the output of the following Python code ?
tp = (5)
tp1 = tp * 2
print (len(tp1))
(a) 0
(b) 2
(c) 1
(d) Error
11. What will be the output of the following: Python code?
tp =(5,)
tpl= tp * 2
print(len (tp1))
(a) 0
(b) 2
(c) 1
(d) Error
12. Given tp = (5, 3, 1, 9, 0) . Which of the following two statements will give the same output?
(i) print (tp[:-1])
(ii) print (tp[0:5])
(iii) print (tp[0:4])
(iv) print ( tp[-4:])
(a) (i), (ii)
(b) (ii), (iv)
(c) (i), (iv)
(d) (i), (iii)
13. What is the output of the following code ?
t = (10, 20, 30, 40, 50, 50, 70)
print (t[5:-1])
(a) Blank output()
(b) (50,70)
(c) (50, 50, 70)
(d) (50,)
14. What is the output of the following code ?
t = (10, 20, 30, 40, 50, 60, 70)
print (t[5:-1])
(a) Blank output()
(b) (10, 20, 30, 40, 50)
(c) (10, 30, 50, 70)
(d) (60,)
15. Which of the below given functions cannot be used with nested tuples ?
(a) index()
(b) count()
(c) max()
(d) sum(
7 question answer is wrong
ReplyDeletepls give correct information
It is correct. Because tuple have not pop() function. So, it will give Error.
DeleteQuestion no 14 solution is wrong .... I think this is due to repetition of ques 13 and 14
ReplyDeletePlease check again.
Deletethere is no such option as d)60 in the textbook in 14th question.
ReplyDeletePlease run that script in your python you will get output (60,)
Deletewhat is the del a val inside a tuple in python?
ReplyDeleteyou cannot as tuples are immutable
Delete:-)
ReplyDelete😊
DeleteIn question no. 9 correct answer is (a)
ReplyDeleteI have also written option "a"
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )