From bb890bbbfa9a5aca03b5cc38791e71d915086557 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Thu, 26 Jan 2023 11:04:12 -0700 Subject: Add clarifying details Co-authored-by: Caeden Perelli-Harris --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v1.2.3