Vidyalelo
Python · Q24

Python Sets MCQs: Exam

Programming · Python · question 24

Q24

What will be the output of the following Python code snippet? z=set('abc') z.add('xyz') z.update(set(['p', 'q'])) z

A.
{'abc', 'p', 'q', 'xyz'}
B.
{'a', 'b', 'c', ['p', 'q'], 'xyz}
C.
{'a', 'c', 'c', 'p', 'q', 'x', 'y', 'z'}
D.
{'a', 'b', 'c', 'p', 'q', 'xyz'}
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board