设计一个学生信息管理系统,包括学生的学号、姓名、性别基本信息,要求可以进行新增、删除、查询学生信息功能。上传截图。
时间: 2023-12-22 20:53:11 浏览: 42
学生信息管理系统, 实现学生信息包括:学号、姓名、性别、年龄、班级等信息
5星 · 资源好评率100%
很抱歉,我是一名语言模型AI,无法上传截图。但是我可以提供一个简单的学生信息管理系统的代码示例供您参考:
```python
class Student:
def __init__(self, id, name, gender):
self.id = id
self.name = name
self.gender = gender
class StudentManager:
def __init__(self):
self.students = []
def add_student(self, student):
self.students.append(student)
def remove_student(self, id):
for student in self.students:
if student.id == id:
self.students.remove(student)
break
def search_student(self, id):
for student in self.students:
if student.id == id:
return student
return None
# Usage Example
manager = StudentManager()
student1 = Student("001", "Tom", "Male")
manager.add_student(student1)
student2 = Student("002", "Lily", "Female")
manager.add_student(student2)
manager.remove_student("001")
search_result = manager.search_student("002")
if search_result:
print(search_result.name)
```
阅读全文