def assign_letter_grade(score): if score >= 85.0: return "A" elif (score>=75.0) and (score < 85.0): return "B" elif (score>=65.0) and (score < 75.0): return "C" elif (score>=55.0) and (score < 65.0): return "D" else: return "F" def calculate_score(score1,score2,score3): total = score1*0.25+score2*0.35+score3*0.4 return total std_no = [] std_name = [] std_letter = [] std_grd = [] std_number = int(input("How many number student will you add? : ")) for i in range(0,std_number): id_no = int(input("Enter the id number of student: ")) name = input("Enter the Name and Surname of Student:") score1 = float(input("Enter the Score1: ")) score2 = float(input("Enter the Score2: ")) score3 = float(input("Enter the Score3: ")) avg_score = calculate_score(score1, score2, score3) letter_grade = assign_letter_grade(avg_score) std_no.append(id_no) std_name.append(name) std_grd.append(avg_score) std_letter.append(letter_grade) print(*std_name) for k in range(0,std_number): print(""" Id : {} Name - Surname : {} Avg. Grade : {} Letter Grade : {} """.format(std_no[k], std_name[k], std_grd[k], std_letter[k]))