Vidyalelo
Python · Q30

Python Sets MCQs: Exam

Programming · Python · question 30

Q30

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]
Answer
C.
{1, 5, ‘xy’}
[1, 5, ‘xy’]
D.
{1, 2, 4, 5, ‘xy’}
[1, 2, 4, 5, ‘xy’]

Answer: Option B

Solution

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