Examveda

What will be the output of the following Python code?
x=set('abcde')
y=set('xyzbd')
x.difference_update(y)
x
y

A. {‘a’, ‘b’, ‘c’, ‘d’, ‘e’}
{‘x’, ‘y’, ‘z’}

B. {‘a’, ‘c’, ‘e’}
{‘x’, ‘y’, ‘z’, ‘b’, ‘d’}

C. {‘b’, ‘d’}
{‘b’, ‘d’}

D. {‘a’, ‘c’, ‘e’}
{‘x’, ‘y’, ‘z’}

Answer: Option B


This Question Belongs to Python Program >> Sets In Python

Join The Discussion

Related Questions on Sets in Python