Question: I am coding a grading system and there is a loop that break is not working in when I use it in. while True: student_name
I am coding a grading system and there is a loop that break is not working in when I use it in.
while True: student_name = input("Please provide the name of the student: ") if student_name in clas.keys(): new_grade = float(input("Please provide the new grade: ")) if 90 <= new_grade <= 100: new_grade = "A" elif 80 <= new_grade < 90: new_grade = "B" elif 70 <= new_grade < 80: new_grade = "C" elif 60 <= new_grade < 70: new_grade = "D" else: new_grade = "F" clas[student_name] = new_grade print(student_name, "'s new grade is: " + new_grade) break
Instead of breaking the loop it keeps asking for the name of the student again, how do I fix this?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
