List methods are indeed functions that modify the value of the Python list. These functions don't return any value because their purpose is to perform operations directly on the corresponding list values.
However, there are some special build-in functions like sorted()
as you can see in the following example, which return the modified list, instead of just changing its values and returning None
:
> l = [9, 4, 7, 1, 2]
> print(l.sort())
None
> print(sorted(l))
[1, 2, 4, 7, 9]
When you invoke list.sort()
, the list is sorted but if you try to print the outcome of the function, you will find that the function is not coded to give any out value, so you will get None
. As shown in the question comments, you can learn more about this behavior on the official Python documentation.