You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Given the names and grades for each student in a Physics class of
2
+
3
+
# students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade.
4
+
5
+
# Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line.
6
+
7
+
# Input Format
8
+
9
+
# The first line contains an integer,
10
+
# , the number of students.
11
+
# The subsequent lines describe each student over
12
+
13
+
# lines; the first line contains a student's name, and the second line contains their grade.
14
+
15
+
# Constraints
16
+
17
+
# There will always be one or more students having the second lowest grade.
18
+
19
+
# Output Format
20
+
21
+
# Print the name(s) of any student(s) having the second lowest grade in Physics; if there are multiple students, order their names alphabetically and print each one on a new line.
22
+
23
+
# Sample Input 0
24
+
25
+
# 5
26
+
# Harry
27
+
# 37.21
28
+
# Berry
29
+
# 37.21
30
+
# Tina
31
+
# 37.2
32
+
# Akriti
33
+
# 41
34
+
# Harsh
35
+
# 39
36
+
37
+
# Sample Output 0
38
+
39
+
# Berry
40
+
# Harry
41
+
42
+
# Explanation 0
43
+
44
+
# There are
45
+
46
+
# students in this class whose names and grades are assembled to build the following list:
# belongs to Tina. The second lowest grade of belongs to both Harry and Berry, so we order their names alphabetically and print each name on a new line.
0 commit comments