Tuple MCQ in Python
Tuples : CBSE Syllabus : 2021 – 22)
Introduction, indexing, tuple operations (concatenation, repetition, membership & slicing)
Built-in functions: len(), tuple(), count(), index(), sorted(), min(), max(), sum();
Tuple assignment, nested tuple
Suggested programs: finding the minimum, maximum, mean of values stored in a tuple; linear search on a tuple of numbers, counting the frequency of elements in a tuple
(Tuple MCQ in Python)
Tuple MCQ in Python
Q1. Tuples are __________________
a. Mutable
b. Immutable
c. Mutable to some extent
d. None of the above
Q2. Tuples can contain elements of any data type.(T/F)
a. True
b. False
Q3. In tuples values are enclosed in __________________
a. Square brackets
b. Curly brackets
c. Parenthesis
d. None of the above
Q4. Write the output of the following.
A = tuple(“Python”)
print(A)
a. (python)
b. (“Python”)
c. (‘P’ , ‘y’ , ‘t’ , ‘h’ , ‘o’ , ‘n’)
d. None of the above
Q5. len( ) function returns the number of elements in tuple.(T/F)
a. True
b. False
Tuple MCQ in Python
Q6. Write the output of the following:
A = list(tuple(“Python”))
print(A)
a. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’)
b. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
c. none of the above
d. Error
Q7. Write the output of the following.
a=(23,34,65,20,5)
print(a[0]+a.index(5))
a. 28
b. 29
c. 27
d. 26
Q8. Which of the following is not a function of tuple?
a. update( )
b. min( )
c. max( )
d. count( )
Q9. 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)
a. 54
b. 93
c. 94
d. Error
Q10. Write the output of the following:
a=(1, 2, 3, 2, 3, 4, 5)
print(min(a) + max(a) + a.count(2))
a. 13
b. 6
c. 8
d. Error
Tuple MCQ in Python
Click here to check your Performance in Tuple MCQ in Python
Tuple MCQ in Python
Q11. Which of the following is/are features of tuple?
a. Tuple is immutable
b. Tuple is a sequence data type.
c. In tuple, elements are enclosed in Parenthesis.
d. All of the above
Q12. Which of the following is not a tuple?
a. P = 1,2,3,4,5
b. Q = (‘a’, ‘b’, ‘c’)
c. R = (1, 2, 3, 4)
d. None of the above
Q13. Which of the following statement will create an empty tuple?
a. P = ( )
b. Q = tuple( )
c. Both of the above
d. None of the above
Q14. Which of the following is a tuple with single element?
a. t = (1,)
b. t = 1,
c. Both of the above
d. None of the above
Q15. Write the output of the following:
>>>t = (1) >>>type(t)
a. <class ‘int’>
b. <class ‘float’>
c. <class ‘tuple’>
d. <class ‘list’>
Q16. What is the length of the given tuple? >>> t1=(1,2,(3,4,5))
a. 1
b. 2
c. 3
d. 4
Q17. Write the output of the following:
>>>t1 = (1,2,3,4,5) >>>t2=t1 >>>t2
a. Error
b. (1,2,3,4,5)
c. 1,2,3,4,5
d. [1,2,3,4,5]
Q18. Write the output of the following:
>>>t1= ('a', 'b')
>>>t2 = (1,2,3)
>>>t2+t1
a. (‘a’, ‘b’, 1, 2, 3)
b. (1, 2, 3, ‘a’, ‘b’)
c. (1, ‘a’, 2, ‘b’, 3)
d. None of the above
Q19. Which of the following statement will return an error. T1 is a tuple.
a. T1 + (23)
b. T1 + [3]
c. Both of the above
d. None of the above
Q20. Which mathematical operator is used to replicate a tuple?
a. Addition
b. Multiplication
c. Exponent
d. Modulus
Tuple MCQ in Python
Click here to check your Performance in Tuple MCQ in Python
Tuple MCQ in Python
Q21. Write the output of the following:
t1 = (23, 45, 67, 43, 21, 41)
print(t1[1:2])
a. (45)
b. (45,)
c. (45, 67)
d. None of the above
Q22. Write the output of the following:
t1 = ('1', '2', '3', '4', '5')
print(t1 + tuple("tuple"))
a. (‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘t’, ‘u’, ‘p’, ‘l’, ‘e’)
b. (‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘tuple’)
c. Error
d. None of the above
Q23. Which function returns the length of tuple?
a. length( )
b. len( )
c. size( )
d. None of the above
Q24. Write the output of the following :
>>>t1 = (1,2)
>>> t2 = (2,1)
>>> t1 == t2
a. True
b. False
c. Error
d. None of the above
Q25. Write the output of the following :
>>>t1 = (1,2)
>>> t2 = (1.0, 2.0)
>>> t1 == t2
a. True
b. False
c. Error
d. None of the above
Q26. del t1 statement will delete the tuple named ‘t1’.(T/F)
a. True
b. False
Q27. What type of error is shown by following statement?
>>>t1 =(1, 2)
>>>t2
a. ValueError
b. TypeError
c. NameError
d. None of the above
Q28. Write the output of the following.
>>> t1=((1,2),(3,4),(9,))
>>>max(t1)
a. 9
b. (9,)
c. (3,4)
d. Error
Q29. >>>min(t1) will return an error if the tuple t1 contains value of mixed data type.(T/F)
a. True
b. False
Q30. Which of the following function return the frequency of particular element in tuple?
a. index( )
b. max( )
c. count( )
d. None of the above
Tuple MCQ in Python
Click here to check your Performance
Tuple MCQ in Python
Q31. Write the output of the following :
>>> t1=(1,2,3,4,5,6,7)
>>> t1[t1[1]]
a. 2
b. 1
c. 3
d. 4
Q32. Write the output of the following :
>>> t1=(1,2,3,4,5,6,7)
>>> t1[t1[1]] + t1[t1[-4]]
a. 8
b. 9
c. 6
d. 7
Q33. Write the output of : >>> tuple(“csiplearninghub”).count(“i”)
a. 1
b. 2
c. 3
d. Error
Q34. Write the output of : >>> sorted(tuple(“Amit”))
a. [‘t’, ‘i’, ‘m’, ‘A’]
b. [‘A’, ‘m’, ‘i’, ‘t’]
c. [‘A’, ‘i’, ‘m’, ‘t’]
d. None of the above
Q35. Which of the following statement create tuple?
a. t1 = (1, 2, 3, 4)
b. t1[1] = (1, 2, 3, 4)
c. Both of the above
d. None of the above
Q36. Which of the following operation work on tuples?
a. Concatenation
b. Slicing
c. Repetition
d. All of the above
Q37. Write the output of the following:
>>> (n1,n2)=tuple("25")
>>> n2+n1
a. 7
b. 25
c. 52
d. Error
Q38. What is the length of given tuple? ((((1,2,3,4), ‘a’, ‘b’),’g’, 1, 3), “Sonu”)
a. 4
b. 3
c. 2
d. 1
Q39. Write the output of the following:
>>> t1 = ((101,"Amit",98),(102,"Geetu",95),(103,"Manoj",87),(104,"Sawan",79)) >>> str(t1[2][2]) + str(t1[3][2])
a. 193
b. 9587
c. 8779
d. 166
Q40. Which function takes tuple as argument?
a. max( )
b. min( )
c. sum( )
d. All of the above
Tuple MCQ in Python
Click here to check your Performance
Tuple MCQ in Python
Q41. Write the output of the following:
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(max(a))
a. Sumanta
b. Ashish
c. Sumit
d. Amit
Q42. What type of error is returned by following code :
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(a.index(“Suman”))
a. SyntaxError
b. ValueError
c. TypeError
d. NameError
Q43. Write the output of the following :
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(a.index(“Sumit”)+4//3**2)
a. 2
b. 4
c. 1
d. 3
Q44. Write the output of the following:
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(a.count(“Sum”))
a. 1
b. 2
c. 0
d. Error
Q45. Write the output of the following :
a=("Amit", "Sumit","Ashish","Sumanta") for i in a: print(len(i)**2)
a.
0
1
4
9
b.
16
25
36
49
c.
Error
d.
1
4
9
16
Q46. Write the output of the following:
a=(6,8,9,"Sumanta",1) for i in a: print(str(i)*2)
a.
66
88
99
SumantaSumanta
11
b.
66
88
99
Error
c.
Error
d.
66 88 99 SumantaSumanta Error
Q47. Write the output of the following:
a="blog"
b=list(a)
c=tuple(b)
print(c)
a. Error
b. [‘b’ , ‘l’ , ‘o’ , ‘g’]
c. (‘b’ , ‘l’ , ‘o’ , ‘g’)
d. (blog)
Q48. Write the output of the following :
a=("Hello","How","are","you")
for i in a:
print(i,end=" ")
a. “Hello” , “How” , “are” , “you”
b. Hello , How , are , you
c. Hello How are you
d. Error
Q49. Write the output of the following:
a=("Hello","How","are","you") for i in a: print(a.index(i),end=" ")
a. 0 1 2 3
b. “Hello” , “How” , “are” , “you”
c. Error
d. 0 2 3
Q50. Write the output of the following:
a=(“Hello”,”How”,”are”,”you”)
b=list(a)
print(a==b)
a. SyntaxError
b. ValueError
c. True
d. False
Q51. Write the output of the following:
a=("Amita", "How", "are", "you", "a") for i in range(len(a)): if(a[i]=="a"): print(a[i])
a. Hello
b. How
c. a
d. you
Tuple MCQ in Python
Click here to check your Performance
Tuple MCQ in Python
Disclaimer : I tried to give you the correct “Tuple MCQ in Python with Answers” , but if you feel that there is/are mistakes in any question or answers of “Tuple MCQ in Python” given above, you can directly contact me at csiplearninghub@gmail.com. Book and Study material available on CBSE official website is used as reference to create above “Tuple MCQ in Python”
Tuple MCQ in Python
Class 12 Computer Science Sample Paper 2020-2021.
Class 12 Computer Science Sample Paper Marking Scheme
Class 12 Computer Science Chapter wise MCQ
Last wale ka answer nhi hai
Please add
Answer added Akshansh Mishra. Thanks for your feedback.