From 23f8e01cf9e712ed823532fefc0768e321aadd08 Mon Sep 17 00:00:00 2001 From: HJW20 <1264519711@qq.com> Date: Tue, 24 Jun 2025 11:36:44 +0800 Subject: [PATCH] 1 --- 面向对象学生系统/Dal/find_students_by_sid.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 面向对象学生系统/Dal/find_students_by_sid.py diff --git a/面向对象学生系统/Dal/find_students_by_sid.py b/面向对象学生系统/Dal/find_students_by_sid.py new file mode 100644 index 0000000..18ab8a1 --- /dev/null +++ b/面向对象学生系统/Dal/find_students_by_sid.py @@ -0,0 +1,6 @@ +def find_student_by_sid(self,sid:str)-> Optional[Student]: + students =self.load_students() + for student in students: + if student.sid==sid: + return student + return None \ No newline at end of file