hacker rank python(Nested Lists)solution
Nested Lists
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( 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)
Comments