Which expression creates an empty set in Python?
Correct answer B. set()
Explanation
Curly braces with nothing inside create an empty dictionary, not a set, because dict literals came first. The only way to create an empty set is to call set(). Non-empty sets can use braces, as in {1, 2}, while [] is an empty list and () is an empty tuple.
Answer checked How we write and check questions
Discussion