-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrades(AA BB CC...).py
38 lines (26 loc) · 1.06 KB
/
Grades(AA BB CC...).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
26
27
28
29
30
31
32
33
34
35
36
37
38
# Grades calculator
# To take input as many as number of students
number_of_students = int(input("Enter the number of students: "))
letter_grades = []
# In while loop taking (name, grades)
while number_of_students > 0:
names_student = input("Enter the name and surname of the student: ")
achievement_grade = int(input("Enter the achievement grade of the student: "))
final_grade = int(input("Enter the final grade of the student:"))
overall_grade = achievement_grade * 0.4 + final_grade * 0.6
letter_grade = ""
if 85 <= overall_grade <= 100 :
letter_grade = "AA"
elif 70 <= overall_grade < 85 :
letter_grade = "BA"
elif 60 <= overall_grade < 70 :
letter_grade = "BB"
elif 50 <= overall_grade < 60 :
letter_grade = "CB"
elif 40 <= overall_grade < 50 :
letter_grade = "CC"
elif 0 <= overall_grade < 40 :
letter_grade = "FF"
letter_grades.append(names_student + " : " + str(overall_grade) + "/" + letter_grade)
number_of_students = number_of_students - 1
print(letter_grades)