K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
每个商品数据为包含price(售价,整数)、sales(销量,整数)、upload_time(上架时间戳,整数)字段的字典列表,变量goods为该列表实例。
price
sales
upload_time
goods
sorted(goods, key=lambda x: (-x['price'], x['sales'], x['upload_time']))
sorted(goods, key=lambda x: (x['price'], x['sales'], x['upload_time']))
sorted(goods, key=lambda x: (x['price'], -x['sales'], x['upload_time']))
sorted(goods, key=lambda x: (-x['price'], -x['sales'], -x['upload_time']))