Created
November 23, 2016 17:03
-
-
Save manashmandal/2ce709a9f2676b58efe8004a85eb3cf1 to your computer and use it in GitHub Desktop.
HackerRank Problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python3 | |
# https://www.hackerrank.com/challenges/nested-list | |
n = int(input()) | |
students = [] | |
for i in range(n): | |
name = input() | |
mark = input() | |
students.append([name, float(mark)]) | |
# Getting the marks [sorted] | |
second_lowest = sorted(list(set([students[i][1] for i in range(n)])))[1] | |
# Getting the persons who got the second lowest mark | |
students_second_lowest = sorted([student[0] for student in students if student[1] == second_lowest]) | |
for student in students_second_lowest: | |
print(student) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what will be the output, if I try as like this example(test case)?
1
Harry
37.21