forked from dheeraj3choudhary/Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_score.py
25 lines (18 loc) · 841 Bytes
/
student_score.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Author :- Biresashis das
# In this program we will print the name of the Student who score the second lowest score.
if __name__ == '__main__':
score_list = []
score_1 = []
no_of_students = int(input("Enter the number of students : "))
for _ in range(no_of_students):
name = input("Enter the name of Student : ").title()
score = float(input(f"Enter the score of {name} : "))
score_list.append([name, score])
score_1.append(score)
score_1 = list(set(score_1))
score_1.sort()
score_list.sort()
second_lowest = score_1[1]
for name,score in score_list:
if score == second_lowest:
print(f"The second lowest score is {score_1[1]} and the Student who got this score is : {name}")