A

Admin • 833.24K Points
Coach

Q. What will be the output of this code?

Code:
a = {1, 2, 3}
b = {2, 3, 4}
print(a & b)
  • (A) {1, 4}
  • (B) {2, 3}
  • (C) {1, 2, 3, 4}
  • (D) {}
  • Correct Answer - Option(B)
  • Views: 23
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

`&` performs set intersection.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.