SyntaxFix
Write A Post
Hire A Developer
Questions
The problem is here:
answer = newList.sort()
sort does not return the sorted list; rather, it sorts the list in place.
sort
Use:
answer = sorted(newList)