Why is my Python sorted-list variable None after I call names.sort()?
TechnologyMy practice script uses `ordered = names.sort()`. Afterwards ordered is None, while names itself has changed into alphabetical order. I expected the method to give me a sorted list to put into the second variable.
Python's sorting guide says list.sort changes the list in place and returns None, whereas sorted builds a new list. Python's sorting guide
Which should I use if I need an alphabetical display and also want to keep the original check-in order? I don't want to hide the None result by reloading data until I understand which operation changed what.