Why does "return list.sort()" return None, not the list?
The problem is here:
answer = newList.sort()
sort
does not return the sorted list; rather, it sorts the list in place.
Use:
answer = sorted(newList)
list.sort
sorts the list in place, i.e. it doesn't return a new list. Just write
newList.sort()
return newList