adplus-dvertising
frame-decoration

Question

What is the output of the snippet of code shown below?
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’}

Posted under Tuples and Sets Python

Answer: (b).{‘a’, ‘c’, ‘e’}
{‘x’, ‘y’, ‘z’, ‘b’, ‘d’}

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the snippet of code shown below?