From 6e85a4552e23e911686e6ae7ee59d06ee1016fc4 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 3 Apr 2023 07:15:40 +0100 Subject: [PATCH] Autosave: 2023-04-03 07:15:40 --- .../Python/Syntax/Sets_in_Python.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Programming_Languages/Python/Syntax/Sets_in_Python.md b/Programming_Languages/Python/Syntax/Sets_in_Python.md index c2f1d45..199eaf1 100644 --- a/Programming_Languages/Python/Syntax/Sets_in_Python.md +++ b/Programming_Languages/Python/Syntax/Sets_in_Python.md @@ -69,6 +69,20 @@ print(basket) # {'apricot', 'pear', 'banana', 'orange'} ``` +## Start with empty set + +To declare an empty set you cannot just do: + +```py +my_set = {} +``` + +You have to use a constructor: + +```py +my_set = set() +``` + ## Apply unions and intersections ```python