Question: I am making a program with a dictionary created by user input, with a menu that takes user input to do things with the grades.
I am making a program with a dictionary created by user input, with a menu that takes user input to do things with the grades. I need help with menu option 2 - Report of Grades.
It sorts them based off their integer value, assigning each value to a letter grade. The format needs to be printed like this:
A: (value)
B: (value)
C: (value)
D: (value)
F: (value)
Each letter grade is on a 10 point scale, so
A = 90 - 100
B = 80 - 90
C = 70 - 80
D = 60 - 70
F - 60 and below
Here is what I have so far:
class_size=int(input("Please, enter the class size: ")) clas={} for x in range(class_size): student_name = input("Please, enter the student name: ") student_grade = int(input("Please, enter the student grade: ")) clas[student_name] = student_grade def menu1(): print("1 - List Student Grades") print("2 - Report of Grades") print("3 - Modify a Grade") print("4 - Exit Program")
menu1() option = int(input("Select an Option: ")) while 1 <= option <= 4: if option == 1: print('List of Student Grades: ') for key, value in clas.items(): print(f"{key}'s grade is {value}") elif option == 2: print('Report of Grades')
student_grade are the values I need to list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
