Skip to content

Instantly share code, notes, and snippets.

@allieus
Created March 30, 2017 09:43
Show Gist options
  • Save allieus/b43a0ebb23d12d84e7c18f7dcb7cbedf to your computer and use it in GitHub Desktop.
Save allieus/b43a0ebb23d12d84e7c18f7dcb7cbedf to your computer and use it in GitHub Desktop.
다수 기준으로 정렬하기
mylist = [10, 11, 9, 20, 12, 313, 211, 121]
def sort_fn(value):
return (len(str(value)), value%10)
mylist.sort(key=sort_fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment