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: concepts/comparisons/about.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ For the other numeric types ([complex][complex numbers], [decimal][decimal numbe
32
32
For more information on the rules that python uses for numeric conversion, see [arithmetic conversions][arithmetic conversions] in the Python documentation.
33
33
34
34
```python
35
-
import fractions
35
+
>>>import fractions
36
36
37
37
# A string cannot be converted to an int.
38
38
>>>17=='17'
@@ -118,7 +118,6 @@ False
118
118
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.
119
119
120
120
```python
121
-
# Comparing lists
122
121
>>> [1, 2] == [1, 2]
123
122
True
124
123
@@ -180,6 +179,8 @@ Due to their singleton status, `None` and `NotImplemented` should always be comp
180
179
See the Python reference docs on [value comparisons][value comparisons none] and [PEP8][PEP8 programming recommendations] for more details on this convention.
181
180
182
181
```python
182
+
>>>
183
+
# A list of favorite numbers.
183
184
>>> my_fav_numbers = [1, 2, 3]
184
185
185
186
>>> your_fav_numbers = my_fav_numbers
@@ -216,6 +217,7 @@ The operators `in` and `not in` test for _membership_.
216
217
For string and bytes types, `<name> in <fullname>` is `True`_**if and only if**_`<name>` is a substring of `<fullname>`.
0 commit comments