11 Cstuple
11 Cstuple
CLASS XI
TUPLE ASSISGNMENT
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]
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.