List Methods Reference
Python’s lists come with a powerful set of built-in methods. These methods can be categorized into two groups: those that mutate (modify) the list in-place, and those that are non-mutating, returning a new value without changing the original list.
1. Mutating Methods (Modify the List In-Place)
These methods change the list they are called on. They typically return None to signal that the change happened in-place.
For sorting, the built-in function sorted(iterable) provides the same functionality but returns a new, sorted list instead of modifying the original in-place.
2. Non-Mutating Methods (Return a Value)
These methods inspect the list and return a value without changing the original list.
Last updated on