Skip to content

Commit a13b2cc

Browse files
committed
Update funcWithSetsAndDict.rst
added new stuff and fixes
1 parent 7ee0751 commit a13b2cc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

_sources/functions/funcWithSetsAndDict.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Sets Do Not Allow Duplicates
128128

129129
+ Yes, it ignores the duplicate item.
130130

131-
- 1, 2, 3, 3
131+
- 1, 2, 3, 1
132132

133133
- No, sets do not allow duplicate items.
134134

@@ -156,7 +156,7 @@ Adding Mutliple Items to a Set
156156
.. activecode:: func_set_udpate_ac
157157
:caption:
158158

159-
Run this code to see what it prints.
159+
Run this code to see what it prints. You will get an error. Remove the code that causes the error and run it again.
160160
~~~~
161161
# create the sets
162162
s1 = {8, 3, 5}
@@ -174,7 +174,7 @@ Adding Mutliple Items to a Set
174174

175175
.. Note::
176176

177-
The set method add only adds one item to a set. To add several items use the set update method.
177+
The set ``add`` method only adds one item to a set. To add several items use the set ``update`` method.
178178

179179
Set Methods
180180
==============
@@ -185,7 +185,7 @@ You can use the following methods with sets.
185185
* set1.difference(other_set) - returns a new set with the items in the first set that are not in the second set
186186
* set1.issubset(other_set) - returns True if the set is a subset of the other set
187187
* set1.issuperset(other_set) - returns True if the set is a superset of the other set
188-
* set1.semmantic_difference(other_set) - returns a new set with the items that are in either set but not both
188+
* set1.semmantic_difference(other_set) - returns a new set with the items that are in either set, but not both. This is also known as an exclusive or (XOR).
189189

190190
.. activecode:: func_set_union_int_ac
191191
:caption: Set methods

0 commit comments

Comments
 (0)