Skip to content

Commit 64ce10d

Browse files
authored
[Cater Waiter & Sets Concept]: Better Differentiation of Emoji Examples in Introduction & About Files (#3991)
* Changed emoji examples in indtroduction to be more differentiated. * Differentiated emoji examples in about.md doc as well. * Change one more example to differentiate.
1 parent 3297093 commit 64ce10d

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

concepts/sets/about.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ While sets can be created in many different ways, the most straightforward const
3434
A `set` can be directly entered as a _set literal_ with curly `{}` brackets and commas between elements.
3535
Duplicates are silently omitted:
3636

37+
3738
```python
38-
>>> one_element = {'😀'}
39-
{'😀'}
39+
>>> one_element = {''}
40+
{''}
4041

41-
>>> multiple_elements = {'😀', '😃', '😄', '😁'}
42-
{'😀', '😃', '😄', '😁'}
42+
>>> multiple_elements = {'', '🔻', '🔹', '🔆'}
43+
{'', '🔻', '🔹', '🔆'}
4344

4445
>>> multiple_duplicates = {'Hello!', 'Hello!', 'Hello!',
4546
'¡Hola!','Привіт!', 'こんにちは!',
@@ -108,19 +109,19 @@ Remember: sets can hold different datatypes and _nested_ datatypes, but all `set
108109

109110
```python
110111
# Attempting to use a list for a set member throws a TypeError
111-
>>> lists_as_elements = {['😅','🤣'],
112-
['😂','🙂','🙃'],
113-
['😜', '🤪', '😝']}
112+
>>> lists_as_elements = {['🌈','💦'],
113+
['☁️','⭐️','🌍'],
114+
['⛵️', '🚲', '🚀']}
114115

115116
Traceback (most recent call last):
116117
File "<stdin>", line 1, in <module>
117118
TypeError: unhashable type: 'list'
118119

119120

120121
# Standard sets are mutable, so they cannot be hashed.
121-
>>> sets_as_elements = {{'😅','🤣'},
122-
{'😂','🙂','🙃'},
123-
{'😜', '🤪', '😝'}}
122+
>>> sets_as_elements = {{'🌈','💦'},
123+
{'☁️','⭐️','🌍'},
124+
{'⛵️', '🚲', '🚀'}}
124125

125126
Traceback (most recent call last):
126127
File "<stdin>", line 1, in <module>
@@ -131,14 +132,15 @@ However, a `set` of `sets` can be created via type `frozenset()`:
131132

132133
```python
133134
# Frozensets don't have a literal form.
134-
>>> set_1 = frozenset({'😜', '😝', '🤪'})
135-
>>> set_2 = frozenset({'😅', '🤣'})
136-
>>> set_3 = frozenset({'😂', '🙂', '🙃'})
135+
>>> set_1 = frozenset({'🌈','💦'})
136+
>>> set_2 = frozenset({'☁️','⭐️','🌍'})
137+
>>> set_3 = frozenset({'⛵️', '🚲', '🚀'})
137138

138139
>>> frozen_sets_as_elements = {set_1, set_2, set_3}
139140
>>> frozen_sets_as_elements
140-
{frozenset({'😜', '😝', '🤪'}), frozenset({'😅', '🤣'}),
141-
frozenset({'😂', '🙂', '🙃'})}
141+
{frozenset({'⛵️', '🚀', '🚲'}),
142+
frozenset({'🌈', '💦'}),
143+
frozenset({'☁️', '⭐️', '🌍'})}
142144
```
143145

144146

exercises/concept/cater-waiter/.docs/introduction.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ A `set` can be directly entered as a _set literal_ with curly `{}` brackets and
3232
Duplicates are silently omitted:
3333

3434
```python
35-
>>> one_element = {'😀'}
36-
{'😀'}
35+
>>> one_element = {''}
36+
{''}
3737

38-
>>> multiple_elements = {'😀', '😃', '😄', '😁'}
39-
{'😀', '😃', '😄', '😁'}
38+
>>> multiple_elements = {'', '🔻', '🔹', '🔆'}
39+
{'', '🔻', '🔹', '🔆'}
4040

4141
>>> multiple_duplicates = {'Hello!', 'Hello!', 'Hello!',
4242
'¡Hola!','Привіт!', 'こんにちは!',
@@ -91,19 +91,19 @@ Sets can hold different datatypes and _nested_ datatypes, but all `set` elements
9191

9292
```python
9393
# Attempting to use a list for a set member throws a TypeError
94-
>>> lists_as_elements = {['😅','🤣'],
95-
['😂','🙂','🙃'],
96-
['😜', '🤪', '😝']}
94+
>>> lists_as_elements = {['🌈','💦'],
95+
['☁️','⭐️','🌍'],
96+
['⛵️', '🚲', '🚀']}
9797

9898
Traceback (most recent call last):
9999
File "<stdin>", line 1, in <module>
100100
TypeError: unhashable type: 'list'
101101

102102

103103
# Standard sets are mutable, so they cannot be hashed.
104-
>>> sets_as_elements = {{'😅','🤣'},
105-
{'😂','🙂','🙃'},
106-
{'😜', '🤪', '😝'}}
104+
>>> sets_as_elements = {{'🌈','💦'},
105+
{'☁️','⭐️','🌍'},
106+
{'⛵️', '🚲', '🚀'}}
107107

108108
Traceback (most recent call last):
109109
File "<stdin>", line 1, in <module>

0 commit comments

Comments
 (0)