MCQs Practice Portal - robustlifestyles.com

Python MCQ Quiz Hub

Tuple MCQ in Python

Choose a topic to test your knowledge and improve your Python skills

Tuples are __________________





✅ Correct Answer: 2

In tuples values are enclosed in __________________





✅ Correct Answer: 3

Write the output of the following. a=(23,34,65,20,5) print(a[0]+a.index(5))





✅ Correct Answer: 3

Which of the following is not a function of tuple?





✅ Correct Answer: 1

Write the output of the following: a=(23,34,65,20,5) s=0 for i in a: if i%2==0: s=s+a[i] print(s)





✅ Correct Answer: 4

Write the output of the following: a=(1, 2, 3, 2, 3, 4, 5) print(min(a) + max(a) + a.count(2))





✅ Correct Answer: 3

Which of the following is/are features of tuple?





✅ Correct Answer: 4

Which of the following statement will create an empty tuple?





✅ Correct Answer: 3

Which of the following is a tuple with single element?





✅ Correct Answer: 3

What is the length of the given tuple? >>> t1=(1,2,(3,4,5)





✅ Correct Answer: 3

Write the output of the following: >>>t1 = (1,2,3,4,5) >>>t2=t1 >>>t2





✅ Correct Answer: 2

Which of the following statement will return an error. T1 is a tuple.





✅ Correct Answer: 3

Which mathematical operator is used to replicate a tuple?





✅ Correct Answer: 2

Write the output of the following: t1 = (23, 45, 67, 43, 21, 41) print(t1[1:2])





✅ Correct Answer: 1

Which function returns the length of tuple?





✅ Correct Answer: 2

Write the output of the following : >>>t1 = (1,2) >>> t2 = (2,1) >>> t1 == t2





✅ Correct Answer: 2

Write the output of the following : >>>t1 = (1,2) >>> t2 = (1.0, 2.0) >>> t1 == t2





✅ Correct Answer: 1

What type of error is shown by following statement? >>>t1 =(1, 2) >>>t2





✅ Correct Answer: 4

Write the output of the following. >>> t1=((1,2),(3,4),(9,)) >>>max(t1)





✅ Correct Answer: 1

>>>min(t1) will return an error if the tuple t1 contains value of mixed data type.





✅ Correct Answer: 1

Which of the following function return the frequency of particular element in tuple?





✅ Correct Answer: 3

Which of the following function return the frequency of particular element in tuple?





✅ Correct Answer: 3

Which of the following function return the frequency of particular element in tuple?





✅ Correct Answer: 3

Write the output of the following : a=("Amit", "Sumit","Ashish","Sumanta") for i in a: print(len(i)**2)





✅ Correct Answer: 2

Write the output of the following: a=(6,8,9,"Sumanta",1) for i in a: print(str(i)*2)





✅ Correct Answer: 4