Fix Python – Empty set literal?


Asked By – Johan Råde

[] = empty list

() = empty tuple

{} = empty dict

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

Now we will see solution for issue: Empty set literal?


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

This question is answered By – sepp2k

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0