Tuples || Type A || Sumita Arora || Class 11 || Computer science || Information practices || Solution


Q1. Discuss the utility and significance of Tuples, briefly.


Q2. If a is (1, 2, 3)(a) what is the difference (if any) between a * 3 and (a, a, a)? (b) is a * 3 equivalent to a + a + a ? (c) what is the meaning of a[1:1] ?(d) what is the difference between a[1:2] and a[1:1] ?

 

Q3. Does the slice operator always produce a new tuple ? 


Q4. The syntax for a tuple with a single item is simply the element enclosed in a pair of matching parentheses as shown below : t = ("a") Is the above statement true? Why? Why not ? 

.

Q5. Are the following two assignments same ? Why / why not ? (b) T3 = (3, 4, 5) T4 = ((3, 4, 5)) (a) T1 =3, 4, 5 T2 = (3,4 ,5)

 

Q6. What would following statements print ? Given that we have tuple = ('t', 'p', 'I') (a) print("tuple") (b) print(tuple(“tuple")) (c) print (tuple)


Q7. How is an empty tuple created ?.


Q8. How is a tuple containing just one element created ?

 

Q9. How can you add an extra element to a tuple ?

 

Q10. When would you prefer tuples over lists ?


Q11. What is the difference between (30) and (30,) ?


Q12. When would sum() not work for tuples?



Q13. Do min( ), max( ) always work for tuples?



Q14. Is the working of in operator and tuple.index() same?



Q15. How are in operator and index() similar or different ?

8 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. THERE ARE NOT ALL QUESTIONS.....MANY ARE MISSING OF TYPE A ,B AND C....PLS KEEP THE UPDATED VERSION OF THE BOOK...THANK YOU ...

    ReplyDelete
  2. Thank you for answers but plz try explain them too .🙂

    ReplyDelete
  3. This site is awesome I completed my all homeworks.
    Thanks Path Walla

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post