Examveda

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: Option D


This Question Belongs to Python Program >> Sets In Python

Join The Discussion

Related Questions on Sets in Python