summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorStreppel <streppels@gmail.com>2019-02-16 16:07:14 -0200
committerDivay Prakash <divayprakash@users.noreply.github.com>2019-02-16 23:37:14 +0530
commitcbcb987c53ad68e12326c5f7994fc7cfde028a18 (patch)
treee5773b6ae2796d184858df55f4e7120734178d0c /python.html.markdown
parent884d2707d2c9c1722a7c3ee53a07e367909ee2cc (diff)
[python/py3] Updating set info (#3473)
Updating set info to be more descriptive and informative
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown3
1 files changed, 2 insertions, 1 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 651927a7..0cc33a80 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -328,7 +328,8 @@ filled_dict["four"] = 4 # now, filled_dict["four"] => 4
filled_dict.setdefault("five", 5) # filled_dict["five"] is set to 5
filled_dict.setdefault("five", 6) # filled_dict["five"] is still 5
-# Sets store ... well sets (which are like lists but can contain no duplicates)
+# You can declare sets (which are like unordered lists that cannot contain
+# duplicate values) using the set object.
empty_set = set()
# Initialize a "set()" with a bunch of values
some_set = set([1, 2, 2, 3, 4]) # some_set is now set([1, 2, 3, 4])