运动会的队伍记成 (队名, 积分)。写 standings(teams),积分高的在前;积分一样时,队名按字母顺序。返回队名的列表;没有队伍返回 []。
standings([("Red", 6), ("Blue", 9), ("Gold", 6)])→['Blue', 'Gold', 'Red']standings([])→[]def standings(teams):
# 在这里写:key 返回一个元组:先是负的积分,再是队名
ordered = teams
return [name for name, points in ordered]
写好了先点「运行」试试示例,没问题再点「提交」。