|
10 | 10 |
|
11 | 11 | ## 1. Clean up Dish Ingredients |
12 | 12 |
|
13 | | -- The `set()` constructor can take any [iterable][iterable] as an argument. [lists:python/lists](https://exercism.lol/tracks/python/concepts/lists) are iterable. |
14 | | -- Remember: [tuples:python/tuples](https://exercism.lol/tracks/python/concepts/tuples) can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
| 13 | +- The `set()` constructor can take any [iterable][iterable] as an argument. [concept: lists](/tracks/python/concepts/lists) are iterable. |
| 14 | +- Remember: [concept: tuples](/tracks/python/concepts/tuples) can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
15 | 15 |
|
16 | 16 | ## 2. Cocktails and Mocktails |
17 | 17 |
|
18 | 18 | - A `set` is _disjoint_ from another set if the two sets share no elements. |
19 | | -- The `set()` constructor can take any [iterable][iterable] as an argument. [lists:python/lists](https://exercism.lol/tracks/python/concepts/lists) are iterable. |
20 | | -- In Python, [strings:python/strings](https://exercism.lol/tracks/python/concepts/strings) can be concatenated with the `+` sign. |
| 19 | +- The `set()` constructor can take any [iterable][iterable] as an argument. [concept: lists](/tracks/python/concepts/lists) are iterable. |
| 20 | +- In Python, [concept: strings](/tracks/python/concepts/strings) can be concatenated with the `+` sign. |
21 | 21 |
|
22 | 22 | ## 3. Categorize Dishes |
23 | 23 |
|
24 | | -- Using [loops:python/loops](https://exercism.lol/tracks/python/concepts/loops) to iterate through the available meal categories might be useful here. |
| 24 | +- Using [concept: loops](/tracks/python/concepts/loops) to iterate through the available meal categories might be useful here. |
25 | 25 | - If all the elements of `<set_1>` are contained within `<set_2>`, then `<set_1> <= <set_2>`. |
26 | 26 | - The method equivalent of `<=` is `<set>.issubset(<iterable>)` |
27 | | -- [tuples:python/tuples](https://exercism.lol/tracks/python/concepts/tuples) can contain any data type, including other tuples. Tuples can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
28 | | -- Elements within [tuples:python/tuples](https://exercism.lol/tracks/python/concepts/tuples) can be accessed from the left using a 0-based index number, or from the right using a -1-based index number. |
29 | | -- The `set()` constructor can take any [iterable][iterable] as an argument. [lists:python/lists](https://exercism.lol/tracks/python/concepts/lists) are iterable. |
30 | | -- [strings:python/strings](https://exercism.lol/tracks/python/concepts/strings) can be concatenated with the `+` sign. |
| 27 | +- [concept: tuples](/tracks/python/concepts/tuples) can contain any data type, including other tuples. Tuples can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
| 28 | +- Elements within [concept: tuples](/tracks/python/concepts/tuples) can be accessed from the left using a 0-based index number, or from the right using a -1-based index number. |
| 29 | +- The `set()` constructor can take any [iterable][iterable] as an argument. [concept: lists](/tracks/python/concepts/lists) are iterable. |
| 30 | +- [concept: strings](/tracks/python/concepts/strings) can be concatenated with the `+` sign. |
31 | 31 |
|
32 | 32 | ## 4. Label Allergens and Restricted Foods |
33 | 33 |
|
34 | 34 | - A set _intersection_ are the elements shared between `<set_1>` and `<set_2>`. |
35 | 35 | - The set method equivalent of `&` is `<set>.intersection(<iterable>)` |
36 | | -- Elements within [tuples:python/tuples](https://exercism.lol/tracks/python/concepts/tuples) can be accessed from the left using a 0-based index number, or from the right using a -1-based index number. |
37 | | -- The `set()` constructor can take any [iterable][iterable] as an argument. [lists:python/lists](https://exercism.lol/tracks/python/concepts/lists) are iterable. |
38 | | -- [tuples:python/tuples](https://exercism.lol/tracks/python/concepts/tuples) can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
| 36 | +- Elements within [concept: tuples](/tracks/python/concepts/tuples) can be accessed from the left using a 0-based index number, or from the right using a -1-based index number. |
| 37 | +- The `set()` constructor can take any [iterable][iterable] as an argument. [concept: lists](/tracks/python/concepts/lists) are iterable. |
| 38 | +- [concept: tuples](/tracks/python/concepts/tuples) can be formed using `(<element_1>, <element_2>)` or via the `tuple()` constructor. |
39 | 39 |
|
40 | 40 | ## 5. Compile a "Master List" of Ingredients |
41 | 41 |
|
42 | 42 | - A set _union_ is where `<set_1`> and `<set_2>` are combined into a single `set` |
43 | 43 | - The set method equivalent of `|` is `<set>.union(<iterable>)` |
44 | | -- Using [loops:python/loops](https://exercism.lol/tracks/python/concepts/loops) to iterate through the various dishes might be useful here. |
| 44 | +- Using [concept: loops](/tracks/python/concepts/loops) to iterate through the various dishes might be useful here. |
45 | 45 |
|
46 | 46 | ## 6. Pull out Appetizers for Passing on Trays |
47 | 47 |
|
48 | 48 | - A set _difference_ is where the elements of `<set_2>` are removed from `<set_1>`, e.g. `<set_1> - <set_2>`. |
49 | 49 | - The set method equivalent of `-` is `<set>.difference(<iterable>)` |
50 | | -- The `set()` constructor can take any [iterable][iterable] as an argument. [lists:python/lists](https://exercism.lol/tracks/python/concepts/lists) are iterable. |
51 | | -- The [list:python/lists](https://exercism.lol/tracks/python/concepts/lists) constructor can take any [iterable][iterable] as an argument. Sets are iterable. |
| 50 | +- The `set()` constructor can take any [iterable][iterable] as an argument. [concept: lists](/tracks/python/concepts/lists) are iterable. |
| 51 | +- The [concept: list](/tracks/python/concepts/lists) constructor can take any [iterable][iterable] as an argument. Sets are iterable. |
52 | 52 |
|
53 | 53 | ## 7. Find Ingredients Used in Only One Recipe |
54 | 54 |
|
55 | 55 | - A set _symmetric difference_ is where elements appear in `<set_1>` or `<set_2>`, but not **_both_** sets. |
56 | 56 | - A set _symmetric difference_ is the same as subtracting the `set` _intersection_ from the `set` _union_, e.g. `(<set_1> | <set_2>) - (<set_1> & <set_2>)` |
57 | 57 | - A _symmetric difference_ of more than two `sets` will include elements that are repeated more than two times across the input `sets`. To remove these cross-set repeated elements, the _intersections_ between set pairs needs to be subtracted from the symmetric difference. |
58 | | -- Using [loops:python/loops](https://exercism.lol/tracks/python/concepts/loops) to iterate through the various dishes might be useful here. |
| 58 | +- Using [concept: loops](/tracks/python/concepts/loops) to iterate through the various dishes might be useful here. |
59 | 59 |
|
60 | 60 |
|
61 | 61 | [hashable]: https://docs.python.org/3.7/glossary.html#term-hashable |
|
0 commit comments