Tuple MCQ in Python – 1

Q1) Choose the correct option with respect to Python.

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.

View Answer Answer:- b) Tuples are immutable while lists are mutable.

Q2) Which of the following is a Python tuple?

a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

View Answer Answer:- b) (1, 2, 3)

Q3) Which of the following creates a tuple?

a) tuple1 = (“a”,”b”)
b) tuple1[2] = (“a”,”b”)
c) tuple1 = (5)*2
d) None of the above

View Answer Answer:- a) tuple1 = (“a”,”b”)

Q4) Tuples are ____.

a) Mutable
b) Immutable
c) Mutable to some extent
d) None of the above

View Answer Answer:- b) Immutable

Q5) Select which is true for Python tuple.

a) We cannot change the tuple once created
b) A tuple is unordered
c) We can change the tuple once created
d) All

View Answer Answer:- a) We cannot change the tuple once created

Q6) Which of the following is not a function of the tuple?

a) max()
b) min()
c) count()
d) update()

View Answer Answer:- d) update()

Q7) Tuples can’t be made keys of a dictionary.

a) True
b) False

View Answer Answer:- b) False

Q8) Tuples can contain elements of any data type.(T/F)

a) True
b) False

View Answer Answer:- a) True

Q9) Find the output of the given Python program?

>>>t = (1)
>>>type(t)

a) <class ‘int’>
b) <class ‘float’>
c) <class ‘list’>
d) <class ‘tuple’>

View Answer Answer:- a) < class ‘int’ >

Q10) Suppose t = (1, 2, 4, 3), which of the following is incorrect?

a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

View Answer Answer:- b) t[3] = 45

Q11) Find the output of the given Python program?

t = (5,4,3,2,1)
x = sum(t,2)
print(x)

a) 15
b) 17
c) 30
d) Error

View Answer Answer:- b) 17

Also See:- MCQ on Python Tuple– 2

Leave a Comment

Your email address will not be published.