Skip to content
Related Articles

Related Articles

Python-Quizzes | Python Sets Quiz | Question 11
  • Last Updated : 18 Sep, 2020

Question 11: What is the output of the following program?




set1 = set([ 4, 5, (6, 7)]) 
set1.update([10, 11]) 
  
print(set1) 

(A) {4, 5, 6, 7, 10, 11}
(B) {4, 5, 10, 11}
(C) {4, 5, (6, 7), 10, 11}
(D) None


Answer: (C)

Explanation: The update() method accepts lists, strings, tuples as well as other sets as its arguments. In all of these cases, duplicate elements are avoided.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :