GRADE XI – COMPUTER SCIENCE - TUPLE
One Mark Questions
1. What is the output of the following Python expression: (1, 2, 3)[1]?
2. Which of the following is a characteristic of a tuple in Python?
(a) Mutable (b) Immutable (c) Both (d) None
3. What is the result of the expression len((1, 2, 3, 4, 5))?
Two Mark Questions
4. Write a Python statement to create a tuple T containing the values 1, 2, 3, 4, and
5.
5. What is the output of the following Python code?
T = (1, 2, 3)
print(T + (4, 5, 6)))
6. Write a Python expression to find the maximum value in the tuple (12, 45, 7, 23,
56, 89, 34).
7. What will be the output of the following code:
Employee=(‘rajesh’,100,23,[1,2,3])
len(Employee)
8. Which of the following creates a tuple?
(a)t1=("a","b") (b) t1[2]=("a","b") (c) t1=(5)*2 (d) None of the above
9. What is the length of the tuple shown below:
T = ( ( ( ( ‘a’, 1 ), ’b’ , ’c’ ), ’d’ , 2 ) , ’e’ , 3 )
10. What is the difference between (30) and (30,)?
Two Mark Questions
11. Write a Python program to create a tuple T containing 5 integers. Then, find and
print the sum of all the numbers in the tuple.
12. What is the output of the following Python code? Also, explain the reason for the
output.
T = (1, 2, 3)
T[1] = 5
print(T)
13. Write a Python program to create two tuples T1 and T2 containing 3 integers
each. Then, find and print the concatenation of T1 and T2.
Three Mark Questions
14. Write a Python program to create a tuple T containing 10 integers. Then, find
and print the largest and smallest numbers in the tuple. Also, find and print the
sum of all the numbers in the tuple.
15. What is the output of the following Python code? Also, explain the reason for the
output.
T = (1, 2, 3)
T = T + (4, 5, 6)
print(T)
T = T + (7, 8, 9)
print(T)