Examveda

What will be the output of the following Python code snippet?
l=[1, 2, 4, 5, 2, 'xy', 4]
set(l)
l

A. {1, 2, 4, 5, 2, ‘xy’, 4}
[1, 2, 4, 5, 2, ‘xy’, 4]

B. {1, 2, 4, 5, ‘xy’}
[1, 2, 4, 5, 2, ‘xy’, 4]

C. {1, 5, ‘xy’}
[1, 5, ‘xy’]

D. {1, 2, 4, 5, ‘xy’}
[1, 2, 4, 5, ‘xy’]

Answer: Option B


This Question Belongs to Python Program >> Sets In Python

Join The Discussion

Related Questions on Sets in Python