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 = tuple(“Python”) print(A)





✅ Correct Answer: 3

Write the output of the following: A = list(tuple(“Python”)) print(A)





✅ Correct Answer: 2

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 is not a 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

Write the output of the following: >>>t = (1) >>>type(t)





✅ Correct Answer: 1

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

Write the output of the following: >>>t1= ('a', 'b') >>>t2 = (1,2,3) >>>t2+t1





✅ 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

Write the output of the following: t1 = ('1', '2', '3', '4', '5') print(t1 + tuple("tuple"))





✅ 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

del t1 statement will delete the tuple named ‘t1’





✅ 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 : >>> t1=(1,2,3,4,5,6,7) Write the output of the following: a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”) print(max(a)) >>> t1[t1[1]]





✅ Correct Answer: 3

What type of error is returned by following code : a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”) print(a.index(“Suman”))





✅ Correct Answer: 2

Write the output of the following : a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”) print(a.index(“Sumit”)+4//3**2)





✅ Correct Answer: 3

Write the output of the following: a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”) print(a.count(“Sum”))





✅ 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

Write the output of the following: a="blog" b=list(a) c=tuple(b) print(c)





✅ Correct Answer: 3

Write the output of the following : a=("Hello","How","are","you") for i in a: print(i,end=" ")





✅ Correct Answer: 3

Write the output of the following: a=("Hello","How","are","you") for i in a: print(a.index(i),end=" ")





✅ Correct Answer: 1

Write the output of the following: a=(“Hello”,”How”,”are”,”you”) b=list(a) print(a==b)





✅ Correct Answer: 4