What will be the result of {1, 2, 3} & {3, 4, 5} in Python?
-
A
{1, 2}
-
B
{3}
Correct answer
-
C
{3, 4, 5}
-
D
Error
15 views
Explanation
The & operator performs an intersection of two sets, resulting in a set containing elements present in both sets.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ