A

Admin • 833.24K Points
Coach

Q. What will be the output of this code?

Code:
x = {1, 2, 3, 2}
print(len(x))
  • (A) 3
  • (B) 4
  • (C) 2
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 20
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Sets do not allow duplicates. The set becomes {1, 2, 3}, which has length 3.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.