Vidyalelo
Python · Q77

Python Sets MCQs: Exam

Programming · Python · question 77

Q77

What will be the output of the following Python code? s1=1, 2, 3 s2=3, 4, 5, 6 s1.difference(s2) s2.difference(s1)

A.
{1, 2}
{4, 5, 6}
Answer
B.
{1, 2}
{1, 2}
C.
{4, 5, 6}
{1, 2}
D.
{4, 5, 6}
{4, 5, 6}

Answer: Option A

Solution

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