다음 사전을 "remaining_pcs"또는 "discount_ratio"값으로 정렬하는 방법은 무엇입니까?Python 사전에서 사전 키로 정렬
promotion_items = {
'one': {'remaining_pcs': 100, 'discount_ratio': 10},
'two': {'remaining_pcs': 200, 'discount_ratio': 20},
}
편집
내가 위에서 사전의 정렬 된 목록을 받고 무엇을 의미, 사전 자체를 정렬 할 수 없습니다.
사전을 정렬 할 수 없습니다. –