The program didn't work because one list was just a reference of another and not a real copy. I imported deepcopy to make a true copy and changed the sign of the mean to get the requested result.
The problem in example_1.py was that the function didn't return the array. I changed that the function firstly sorts the values in the array and returns the sorted array.