Asked about Lists, dictionaries and sets

What is the difference between sorted(x) and x.sort()?

An answer that works

sorted returns a new sorted list and leaves the original alone. .sort() sorts the list in place and returns None. Assigning the result of .sort() to a variable is a common bug, because you get None.

Reading an answer is not being able to give one. The section that teaches this is Lists, dictionaries and sets, 3 hours of Python.

Learn this properly