Discuss / Python / 打卡

打卡

Topic source

钱老板boss

#1 Created at ... [Delete] [Delete and Lock User]

第一题:

def by_name(t): return t[0]

则key = ['Bob','Adam','Bart','Lisa'],则sorted(key)即可理解

第二题:

def by_score(t): return t[1]*-1

则key = [ -75, -92,-66 , -88]

那么sorted(key)可得顺序为:[-92,-88,-75,-66],对应其元祖即可


  • 1

Reply