selfteaching / selfteaching/selfteaching-python-camp

Day05 sort排序

Open
#2,791 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

在Day5排序问题中,对于字典,我使用了:

dic2=sorted(dic.items(),key=lambda x:(x[1],x[0]),reverse=True)
实现了先按数字排序,数字相同的情况下,按照字母排序。

但是我的目标是:先按数字排从大到小,在一样数字的情况下,再按字母的从小到大排序。求助该如何处理?

感谢帮助!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Day05 sorting exercise and reproduce the reported dictionary-ordering example. Review the exercise context and determine how the requested ordering should be explained; done means the guidance clearly addresses descending numeric order and ascending alphabetical tie-breaking.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
content, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.