What will be the output of the following Python program?

a = {1, 2, 2, 3, 3, 4}
print(len(a))
                        

Options

  • A. 6
  • B. 5
  • C. 4
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. 4

Detailed Explanation

A set stores unique elements. Duplicate values are automatically removed.