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
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,12 +180,12 @@ Set Methods
180
180
==============
181
181
You can use the following methods with sets.
182
182
183
-
* set1.union(other_set) - returns a new set with all the items from each of the sets
184
-
* set1.intersection(other_set) - returns a new set with just the items that are in both sets
185
-
* set1.difference(other_set) - returns a new set with the items in the first set that are not in the second set
186
-
* set1.issubset(other_set) - returns True if the set is a subset of the other set
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. This is also known as an exclusive or (XOR).
183
+
* set1.union(other_set) - returns a new set with all the items from ``set1`` and ``other_set``.
184
+
* set1.intersection(other_set) - returns a new set with just the items that are in both ``set1`` and ``other_set``.
185
+
* set1.difference(other_set) - returns a new set with the items in ``set1`` that are not in ``other_set``.
186
+
* set1.issubset(other_set) - returns True if ``set1`` is a subset (has some of the same elements and no other elements) of ``other_set``.
187
+
* set1.issuperset(other_set) - returns True if set1 is a superset (has all the same elments and may have other elements) of ``other_set``.
188
+
* set1.semmantic_difference(other_set) - returns a new set with the items that are in either ``set1`` or ``other_set``, but not both. This is also known as an exclusive or (XOR).
189
189
190
190
.. activecode:: func_set_union_int_ac
191
191
:caption: Set methods
@@ -205,9 +205,9 @@ You can use the following methods with sets.
205
205
.. fillintheblank:: funct_set_union_fitb
206
206
:practice: T
207
207
208
-
What character can be used to indicate the union of two sets as shown in the code above?
208
+
What character can be used to get the union of two sets as shown in the code above?
209
209
210
-
- :\|: Use a pipe to indicate the union of two sets.
210
+
- :\|: Use a pipe to get the union of two sets.
211
211
:.*: Which gives the same output as the union method?
212
212
213
213
.. activecode:: func_set_diff_sub_ac
@@ -232,9 +232,9 @@ You can use the following methods with sets.
232
232
.. fillintheblank:: funct_set_diff_fitb
233
233
:practice: T
234
234
235
-
What character is used to indicate the difference between two sets in the code above?
235
+
What character is used to get the difference between two sets in the code above?
236
236
237
-
- :\-: Use a dash to indicate the difference between two sets.
237
+
- :\-: Use a dash to get the difference between two sets.
238
238
:.*: Which gives the same output as the difference method?
239
239
240
240
.. activecode:: func_set_super_exor_ac
@@ -258,7 +258,7 @@ You can use the following methods with sets.
258
258
259
259
What character is used to find the symmetric difference (exlusive or) between two sets in the code above?
260
260
261
-
- :\^: Use a ^ to indicate the symmetric difference between two sets (exclusive or)
261
+
- :\^: Use a ^ to get the symmetric difference between two sets (exclusive or)
262
262
:.*: Which gives the same output as the symmetric_difference method?
0 commit comments