summaryrefslogtreecommitdiffhomepage
path: root/python3.html.markdown
diff options
context:
space:
mode:
authormiguel araujo <miguelarauj1o@gmail.com>2014-06-19 11:05:48 -0300
committermiguel araujo <miguelarauj1o@gmail.com>2014-06-19 11:05:48 -0300
commit8c44cb9b4fe45df82588956473e01f7eb7a07dd9 (patch)
tree1a56d8999e1c5402d0e66256b8baeaa6b24ce30c /python3.html.markdown
parent7bc3a435c6716931addb11251bd40fc13d77ce1a (diff)
parent9862212ed15a4b28c946a7b00cd3624d00971b97 (diff)
Merge branch 'master' of https://github.com/miguelarauj1o/learnxinyminutes-docs into translate_br
Diffstat (limited to 'python3.html.markdown')
-rw-r--r--python3.html.markdown5
1 files changed, 4 insertions, 1 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index 77811535..778076f8 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -238,7 +238,10 @@ empty_set = set()
# Initialize a set with a bunch of values. Yeah, it looks a bit like a dict. Sorry.
some_set = {1, 1, 2, 2, 3, 4} # some_set is now {1, 2, 3, 4}
-# Add more items to a set
+#Can set new variables to a set
+filled_set = some_set
+
+# Add one more item to the set
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
# Do set intersection with &