Vidyalelo
Python · Q45

Python Sets MCQs: Exam

Programming · Python · question 45

Q45

What is the output of the following code:set1 = 1, 2, 3set2 = 2, 3, 4print(set1.difference(set2))

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

Answer: Option A

Solution

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