关于作者

Discuss / Python / 作业

作业

问题来源

梘香

#1 Created at ...

L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)] def by_name(t): return t[0]

def by_score(t): return t[1]

L2=sorted(L,key=by_name) print(L2) L3=sorted(L,key=by_score) print(L3)


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.