Skip to content

Commit b2e4001

Browse files
committed
Modified fenced Python REPL code to pass doctest tests.
1 parent c9c576e commit b2e4001

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

concepts/comparisons/about.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For the other numeric types ([complex][complex numbers], [decimal][decimal numbe
3232
For more information on the rules that python uses for numeric conversion, see [arithmetic conversions][arithmetic conversions] in the Python documentation.
3333

3434
```python
35-
import fractions
35+
>>> import fractions
3636

3737
# A string cannot be converted to an int.
3838
>>> 17 == '17'
@@ -118,7 +118,6 @@ False
118118
Container data types (_`lists`, `tuples`, `sets`, `dicts`, etc._) also compare [_lexicographically_][lexographic order] - they are equal if both containers have the same data **and** the same data types (_in the case of `lists` and `tuples`, they must also have the same **ordering**_), unequal otherwise.
119119

120120
```python
121-
# Comparing lists
122121
>>> [1, 2] == [1, 2]
123122
True
124123

@@ -180,6 +179,8 @@ Due to their singleton status, `None` and `NotImplemented` should always be comp
180179
See the Python reference docs on [value comparisons][value comparisons none] and [PEP8][PEP8 programming recommendations] for more details on this convention.
181180

182181
```python
182+
>>>
183+
# A list of favorite numbers.
183184
>>> my_fav_numbers = [1, 2, 3]
184185

185186
>>> your_fav_numbers = my_fav_numbers
@@ -216,6 +217,7 @@ The operators `in` and `not in` test for _membership_.
216217
For string and bytes types, `<name> in <fullname>` is `True` _**if and only if**_ `<name>` is a substring of `<fullname>`.
217218

218219
```python
220+
>>>
219221
# A set of lucky numbers.
220222
>>> lucky_numbers = {11, 22, 33}
221223
>>> 22 in lucky_numbers
@@ -224,13 +226,8 @@ True
224226
>>> 44 in lucky_numbers
225227
False
226228

227-
# A dictionary of employees.
228-
>>> employee = {
229-
'name': 'John Doe',
230-
'id': 67826,
231-
'age': 33,
232-
'title': 'ceo'
233-
}
229+
# A dictionary of employee information.
230+
>>> employee = {'name': 'John Doe', 'id': 67826, 'age': 33, 'title': 'ceo'}
234231

235232
# Checking for the membership of certain keys.
236233
>>> 'age' in employee

0 commit comments

Comments
 (0)