Combine file handling and exception handling to build a program that reads student grades from a simulated data source, calculates averages, and handles bad input gracefully.
YOUR TASK
Create a program that:
Stores a list of student names and grades as a dictionary
Loop through items: for name, grades in students.items(): try: avg = sum(grades) / len(grades) print(f"{name}: {avg:.1f}") except ZeroDivisionError: print(f"{name}: No grades")
Expected output:
Alice: 84.3
Bob: 85.0
Code Editor
Ready
Output
Console
Console initialized...
Ready for Project 3: Student Grade Manager
> Use "Check My Code" to verify your solution
> Complete button unlocks when grades are correct!