From d7129b88a84540e42a88de7119d7ed64a0a3e8ae Mon Sep 17 00:00:00 2001 From: Wiselancer <310760+wiselancer@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:09:29 +0300 Subject: [PATCH] Update 010_Nested_Lists.md Added new solution --- solutions/010_Nested_Lists.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/solutions/010_Nested_Lists.md b/solutions/010_Nested_Lists.md index 5f0e86a..f748953 100644 --- a/solutions/010_Nested_Lists.md +++ b/solutions/010_Nested_Lists.md @@ -74,3 +74,15 @@ if __name__ == '__main__': for student in seconds: print(student) ``` + +## Solution 2 +``` +if __name__ == '__main__': + dict = {} + for _ in range(int(input())): + name = input() + score = float(input()) + dict.setdefault(score, []).append(name) + scores = sorted(dict.items()) + print(*(name for name in sorted(scores.pop(1)[1])), sep='\n') +```