diff options
| author | 2023-01-26 11:04:12 -0700 | |
|---|---|---|
| committer | 2023-01-26 11:04:12 -0700 | |
| commit | bb890bbbfa9a5aca03b5cc38791e71d915086557 (patch) | |
| tree | 442717f8815509156010e5dfe9da7d99b38e160c | |
| parent | Merge branch 'main' into inplace-tag (diff) | |
Add clarifying details
Co-authored-by: Caeden Perelli-Harris <[email protected]>
| -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 49f9bfe2f..880f82527 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 +print(a_new_list[1]) # This will error because it is empty ``` On the other hand, using `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: |