Discuss / Python / 打卡作业

打卡作业

Topic source

Fwmmmm-

#1 Created at ... [Delete] [Delete and Lock User]
L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]def by_name(t):    return str.lower(t[0])def by_chengji(t):    return abs(t[1])L2 = sorted(L, key=by_chengji,reverse=True)print(L2)

  • 1

Reply