class Student:
def __init__(self,no,name,chinese,math,english):
self.no = no
self.name = name
self.chinese = int(chinese)
self.math = int(math)
self.english = int(english)
class StudentList:
def __init__(self):
self.stulist = []
def show(self): # 显示学生信息
print('{:8}\t{:8}\t{:8}\t{:8}\t{:8}'.format('学号','姓名','语文','数学','英语'))
for stu in self.stulist:
print('{:8}\t{:8}\t{:<8}\t{:<8}\t{:<8}'
.format(stu.no,stu.name,stu.chinese,stu.math,stu.english))
def delete(self): # 删除学生信息
while True:
no = input('请输入要删除的学生学号:')
for stu in self.stulist[::]:
if stu.no == no:
python 学生信息管理系统
最新推荐文章于 2024-11-08 13:43:44 发布