Discuss / Python / 交作业

交作业

Topic source

Afternoon Tea

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

L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

L2 = sorted(L, key=lambda t:t[0].lower())
print(L2)

L2 = sorted(L, key=lambda t:t[1], reverse=True)
print(L2)


  • 1

Reply