0% found this document useful (0 votes)
38 views

11 Cstuple

Class 11 tuple work sheets

Uploaded by

ram priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

11 Cstuple

Class 11 tuple work sheets

Uploaded by

ram priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMPUTER SCIENCE

CLASS XI
TUPLE ASSISGNMENT

Q1. Find the incorrect statement/s out of the following:


a) >>> tup1=(1,'2',3,4,5,"6",7,8,9) b)
b) >>>tup4=(170,)
c) >>>tup6= (500)
d) >>>tup7=tuple()
e) >>>tup10=5, 10, 15, 20

Q2 If
>>>tup1=("bag", "book", "copy", "lunch box", "pencil box") >>>tup2=(5, 10, 15, 20, 25, 30, 35)
Give the output: a) >>>tup3= tup1[:] b) >>>tup4= tup2[1:5]

Q3 Give the elements of the following tuple which are present at the given index numbers:
planets=['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune']

a) planets [5]
b) planets [2*2]
c) planets [-4]
d) planets [2:6]
e) planets [2:6:2]
f) planets [:4]
g) planets [2:]
h) planets [::2]
i) planets [::-2]
j) planets [-5:-1]
k) planets [5:2:-2]
l) planets [-2:-5:-1]
m) planets [-1:-5:-2]

Q4. Consider the following tuple:


monuments=[ 'Kutub Minar', 10, 'Taj Mahal', 20, 'India Gate', 30, 'Char Minar', 40]
states=['Delhi', 'Kerala', 'Tamil Nadu', 'Bihar']
Write Python statements for the following. Kindly state the reason for the operations which not
possible.

a) To insert “Red Fort” and “Jantar Mantar” in the tuple monuments


b) To add 50 at the end of the tuple
c) To add tuple of states at the end of the tuple of monuments
d) To replace 3rd, 4th and 5th element of the monuments tuple by “India”.
e) To remove the third element from the tuple monuments.
f) To delete the tuple monuments.
g) To store all elements 2 times in the tuple states.
h) To check whether the element 20 is present in the tuple or not.
i) To swap the elements of tuples, monuments and states.
j) To display all elements of a tuple states in different lines.
Q5 Consider the tuples planets and states and give the output of the following Python statements:
planets=['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune']
states=['Delhi', 'Kerala', 'Tamil Nadu', 'Bihar', 'Delhi']
a) planets=planets+”Tamil”
b) states=states*2
c) len(planets)
d) max(planets)
e) min(planets)
f) count(‘Delhi’)
Q6. Write Python script to display the element with maximum value from the given tuple.

Q7. Write Python script to display the element with minimum value from the given tuple.

Q8. Write Python script to display the sum of elements from the given tuple of numbers.

Q9. Write Python script to display the average of elements from the given tuple of numbers.

Q10. Write a Python script to input a tuple with names of dance forms. Input a dance form and add this
dance form at end of the touple.

You might also like