@@ -18,12 +18,24 @@ myset2={"f","c", "j"}
1818
1919| | Start | Method | Output |
2020| ----------------| -----------------| ------------| ---------------|
21- | add| {} | {} | .add(▢) | {▢} |
22- | clear | ▢☆ | .clear() | {} |
23- | copy a set | △▢☆ | .copy() | ▢▢▢ |
24- | difference | "a","c","c","d" | .difference(myset2) | { "j", "f"} |
25- | discard | △▢☆ | .discard("△") | {"▢", "☆"} |
26- | pop i.e. removes from top | △▢☆ | .pop() | {"▢","☆" } |
27- | remove | ▢☆△ | .remove(☆) | [ ▢,△ ] |
28- | union | | .union(myset2) | {"c", "a", "f", "d", "j"} |
29-
21+ | add| {} | {"hi","how","are","you"} | .add("great") | you, how, hi, great, are |
22+ | clear | {"▢","☆"} | .clear() | {} |
23+ | copy a set | {"△","▢","☆"} | .copy() | ▢▢▢ |
24+ | difference | {"a","c","c","d"} | .difference(myset2) | j, f |
25+ | discard | {"△","▢","☆"} | .discard("△") | ☆,▢ |
26+ | pop i.e. removes from top | {"△","▢","☆"} | .pop() | ▢,☆ |
27+ | remove | {"▢","☆","△"} | .remove("☆") | ▢,△ |
28+ | union | {"a","c","c","d"} | .union(myset2) | c,a,f,d,j |
29+
30+
31+ ### Operators
32+ | Operator | Meaning |
33+ | ----------------| -----------------|
34+ | == | all keys and values in the set1 are equal in set2 |
35+ | != | set1 is not equal to set2 |
36+ | <= | set1 is a subset of set2 |
37+ | >= | set1 is a superset of set2 |
38+ | \| | union of set1 and set2 |
39+ | & | intersecting point of set1 and set2 |
40+ | - | items that are present in set1 but not in set 2 |
41+ | ^| items that are stricly either in set1 or in set2 (i.e. !both )|
0 commit comments