You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _sources/functions/funcWithSetsAndDict.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ Sets Do Not Allow Duplicates
128
128
129
129
+ Yes, it ignores the duplicate item.
130
130
131
-
- 1, 2, 3, 3
131
+
- 1, 2, 3, 1
132
132
133
133
- No, sets do not allow duplicate items.
134
134
@@ -156,7 +156,7 @@ Adding Mutliple Items to a Set
156
156
.. activecode:: func_set_udpate_ac
157
157
:caption:
158
158
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.
160
160
~~~~
161
161
# create the sets
162
162
s1 = {8, 3, 5}
@@ -174,7 +174,7 @@ Adding Mutliple Items to a Set
174
174
175
175
.. Note::
176
176
177
-
The set method addonly 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.
178
178
179
179
Set Methods
180
180
==============
@@ -185,7 +185,7 @@ You can use the following methods with sets.
185
185
* set1.difference(other_set) - returns a new set with the items in the first set that are not in the second set
186
186
* set1.issubset(other_set) - returns True if the set is a subset of the other set
187
187
* 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).
0 commit comments