0% found this document useful (0 votes)
18 views1 page

Tuple Workshet Basic Level1

The document contains a series of questions related to tuples in Python, categorized into one mark, two marks, and three marks questions. It covers topics such as tuple characteristics, operations, and basic programming tasks involving tuples. The questions test understanding of tuple creation, manipulation, and properties in Python.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Tuple Workshet Basic Level1

The document contains a series of questions related to tuples in Python, categorized into one mark, two marks, and three marks questions. It covers topics such as tuple characteristics, operations, and basic programming tasks involving tuples. The questions test understanding of tuple creation, manipulation, and properties in Python.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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)

You might also like