You are viewing a single comment's thread. Return to all comments →
Can anyone explain why the inner2 works but inner(which uses itemgetter() fails for testcase 10,11,12
def person_lister(f): def inner2(people):#works for all testcase people.sort(key=lambda x: int(x[2])) return [f(p) for p in people] def inner(people):#fails test-case 10,11,12 people.sort(key=itemgetter(2)) return [f(p) for p in people] return inner
Seems like cookies are disabled on this browser, please enable them to open this website
Decorators 2 - Name Directory
You are viewing a single comment's thread. Return to all comments →
Can anyone explain why the inner2 works but inner(which uses itemgetter() fails for testcase 10,11,12