1. Home
  2. Data Science
  3. Python
  4. What will be the result of {1, 2, 3} & {3, 4, 5} in Python?

Added 4 May 2024

What will be the result of {1, 2, 3} & {3, 4, 5} in Python?

  1. {1, 2}
  2. {3} Correct answer
  3. {3, 4, 5}
  4. Error

Correct answer

B. {3}

15 views

MCQSEXAM

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

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs