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: exercises/concept/sets/.docs/introduction.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
In Python, a [set](https://docs.python.org/3/library/stdtypes.html#set) is an _unordered_ collection of distinct _hashable_ objects. Like most collections, sets can hold any (or multiple) data type(s) -- as long as those types can be [hashed](https://docs.python.org/3.7/glossary.html#term-hashable). Sets come in two flavors:_mutable_ (`set`) and _immutable_ (`frozenset`).
1
+
In Python, a [set](https://docs.python.org/3/library/stdtypes.html#set) is an _unordered_ collection of distinct _hashable_ objects. Like most collections, sets can hold any (or multiple) data type(s) -- as long as those types can be [hashed](https://docs.python.org/3.7/glossary.html#term-hashable). Sets come in two flavors: _mutable_ (`set`) and _immutable_ (`frozenset`).
2
2
3
3
Sets are most commonly used to remove duplicates from sequences, test for membership (_finding supersets & subsets_), and performing "set math" (_union, intersection, difference & symmetric difference_).
4
4
5
-
Like other collection types such as `dict`, `list`, & `tuple`, `sets`support membership testing through `in`, length calculation through `len()` & _iteration_ via `for item in set`. Unlike the `sequence types``string`, `list` & `tuple`, `sets` are neither ordered nor indexed, and **do not support** indexing, slicing, sorting, or other sequence behavior.
5
+
Like other collection types such as `dict`, `list`, & `tuple`, `sets` support membership testing through `in`, length calculation through `len()` & _iteration_ via `for item in set`. Unlike the `sequence types``string`, `list` & `tuple`, `sets` are neither ordered nor indexed, and **do not support** indexing, slicing, sorting, or other sequence behavior.
0 commit comments