Nitish has declared a tuple T in Python as following

T = (10, 20, 30)
Now, he wants to insert an element 40 after these three elements of T so that the tuple may contain (10, 20, 30, 40).
Which of the following statements shall Nitish write to accomplish the above task

(a) T = T + 40
(b) T = T + (40)
(c) T = T + (40 ,)
(d) Nitish cannot insert 40 into the tuple since Tuples are immutable

2 Comments

Add a Comment
  1. The appropriate answer is option –  

    (d) Nitish cannot insert 40 into the tuple since Tuples are immutable. 

  2. In Preeti Arora ans c is correct
     

Leave a Reply

Your email address will not be published. Required fields are marked *