Vidyalelo
Python · Q26

Python Sets MCQs: Exam

Programming · Python · question 26

Q26

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’}
Answer
C.
{‘b’, ‘d’}
{‘b’, ‘d’}
D.
{‘a’, ‘c’, ‘e’}
{‘x’, ‘y’, ‘z’}

Answer: Option B

Solution

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