Light Mode
Dark Mode
Feedback from user josemoralesp
I have this methos:
def checkio(data):

    #replace this for solution
    mod = (0 if len(data) % 2 else 1) + 1
    half = (len(data) - 1) / 2
    return sum(sorted(data)[half:half + mod]) / float(mod)

Your system raise me this error:
TypeError: slice indices must be integers or None or have an __index__ method, checkio, 6

My method is perfect, I test it in others enviroments and run correctly
  • feedback
Created: Feb. 6, 2014, 3:16 p.m.
Updated: Feb. 9, 2014, 12:44 a.m.
0
3
User avatar
josemoralesp