Python-Quizzes | Python Sets Quiz | Question 11
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
Last Updated :
18 Sep, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...