user763305 user763305 - 4 months ago 36
Python Question

Empty set literal in Python?

[]
= empty
list


()
= empty
tuple


{}
= empty
dict


Is there a similar notation for an empty
set
?
Or do I have to write
set()
?

Answer

No, there's no literal syntax for the empty set. You have to write set().

Comments