diff options
| author | 2023-01-26 11:05:48 -0700 | |
|---|---|---|
| committer | 2023-01-26 11:05:48 -0700 | |
| commit | ae70912045d5c817acecdf0025dd00f6cbb846a6 (patch) | |
| tree | e5a1f5900906e1f6ba8ee91dd7e066ea7ebfd149 | |
| parent | Add missing code blocks (diff) | |
Clarify empty and why it errors.
| -rw-r--r-- | bot/resources/tags/in-place.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index f1d3090fd..8c5df89c9 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -9,7 +9,7 @@ For example, the following code will result in an error: ```py a_list = [3, 1, 2] a_new_list = a_list.sort() # This will be None -print(a_new_list[1]) # This will error because it is empty +print(a_new_list[1]) # This will error because it is NoneType and not a list ``` On the other hand, using the function `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: |