# MCQ on Python Tuple – 2

Q1) Which of the following statements will create an empty tuple?

a) P = ( )
b) Q = tuple( )
c) Both of the above
d) None of the above

Q2) Find the output of the given Python program?

``x = {"Robert":25, "Elon":29}y = x["Elon"]print(y)``

a) Robert
b) Elon
c) 25
d) 29

Q3) What will be the output of the below Python code?

``````tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)``````

a) (5,1,6,2)
b) (5,1,7,6)
c) (5,1,7,6,2)
d) Error

Q4) Is the following Python code valid?

``````>>> a=(5,4,3,2,1)
>>> del a
``````

a) Yes, the entire tuple is deleted
b) Yes, the first element in the tuple is deleted
c) No because the tuple is immutable
d) No, the invalid syntax for the del method

Q5) What is the output of the given below program?

``t = (5,4,3,2,1)x = del(t[3])print(x)``

a) (5, 4, 2, 1)
b) (5, 4, 3, 1)
c) (5, 4)
d) Error

Q6) Find the output of the given Python program?

``t = (3, 5)x = 3 * tprint(x)``

a) (3, 5)
b) (3, 3, 5)
c) (3, 3, 3, 5, 5, 5)
d) (3, 5, 3, 5, 3, 5)

Q7) Find the output of the given Python program?

``t = (3, 5)*3print(t)``

a) (3, 5)
b) (3, 3, 5)
c) (3, 3, 3, 5, 5, 5)
d) (3, 5, 3, 5, 3, 5)

Q8) Which mathematical operator is used to replicate a tuple?

a) Modulus
b) Multiplication
d) Exponent

Q9) What is the output of the given below program?

``t = (5,4,3,2,1)x = t[2:4]print(x)``

a) (4, 2)
b) (3, 2)
c) (5, 4, 1)
d) (4, 3, 2)

Q10) What is the output of the given below program?

``t = (5, 4, 3, 2, 1)x = t[2:-1]print(x)``

a) (4, 2)
b) (3, 2)
c) (5, 4, 1)
d) (4, 3, 2)

``t = (1,2,3,4,5)x = slice(2,4)print(t[x])``