# sorted(List) vs List.sorted() in Python

When I was just starting out with Python I found the distinction between a function doing something in place and returning the result instead pretty interesting.

Understanding this distinction is pretty important as a beginner! Since sorting in one of the most important operations we do in programming, let's look at an example involving exactly that.

➡ sorted(\[a\_list\]): is a built-in function than returns a new sorted list, without modifying the original  
➡ a\_list.sort(): sorts the list in place and doesn't return anything

![](https://miro.medium.com/v2/resize:fit:1400/0*K3GRFmxRomQP2e4e align="left")

*Found it useful? Subscribe to my Analytics newsletter at* [*notjustsql.com*](https://notjustsql.com)*.*
