Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python - dict 정렬 (Key, Value로 sorting) #15

Open
utterances-bot opened this issue Aug 19, 2022 · 1 comment
Open

Python - dict 정렬 (Key, Value로 sorting) #15

utterances-bot opened this issue Aug 19, 2022 · 1 comment

Comments

@utterances-bot
Copy link

Python - dict 정렬 (Key, Value로 sorting)

dict(dictionary)를 Key 또는 Value를 기준으로 정렬하는 방법을 소개합니다. 다음과 같이 sorted()를 이용하여 dict를 정렬할 수 있습니다. 인자로 my_dict.items()를 전달하면 오름차순으로 정렬됩니다. 내림차순으로 정렬하려면 sorted()에 다음과 같이 reverse = True를 인자로 전달해야 합니다. 여기서 lambda가

https://codechacha.com/ko/python-sorting-dict/

Copy link

덕분에 좋은 내용 잘 보고 갑니다
감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants