def medianeven (L): while len(L) > 2: L = L[1:(len(L)-1)] return average (L) def medianodd (L): while len(L) > 1: L = L[1:(len(L)-
The sort() method call you have in the line:
new = L.sort();
doesn't return anything. Thus 'new' holds 'None', which has no length. I believe doing L.sort() will sort the list in place. Don't need to store it in 'new'.