def find_student(self, student_id): """Find a student by ID""" return self.students.get(student_id)
def get_all_students(self): """Return all students sorted by name""" return sorted(self.students.values(), key=lambda s: s.name) python in netbeans
def get_average_grade(self): """Calculate average grade of all students""" if not self.students: return 0 total = sum(s.grade for s in self.students.values()) return total / len(self.students) python in netbeans
def remove_student(self, student_id): """Remove a student by ID""" if student_id in self.students: removed = self.students.pop(student_id) print(f"✓ Student removed.name removed successfully!") return True print(f"Student with ID student_id not found!") return False python in netbeans
def main(): """Main program loop""" manager = StudentManager()