学生管理系统简易版)
用一个变量来保存一个班级的学生信息,学生信息包括:姓名、学号、成绩(英语、体育、美术、数学)、年龄
b.给这个班级添加学生
c.根据姓名查看班级里的某个学生的信息
d.根据姓名删除一个指定的学生信息
e.查看班级的所有的学生信息
f.求指定的学生平均成绩
management_system = [{'name':'dragon','student_id':1,'english':88,'pe':98,'art':78,'math':100,'age':22},\
{'name':'sea','student_id':2,'english':98,'pe':96,'art':88,'math':89,'age':23}]
management_systems = {'name':'longhai','student_id':3,'english':88,'pe':98,'art':78,'math':108,'age':22}
management_systems['name'] = input('请输入姓名')
management_systems['student_id'] = input('请输入学号')
management_systems['english'] = input('请输入英语成绩')
management_systems['pe'] = input('请输入体育成绩')
management_systems['art'] = input('请输入美术成绩')
management_systems['math'] = input('请输入数学成绩')
management_systems['age'] = input('请输入年龄')
management_system.append(management_systems)
print(management_system)
name = input('请输入姓名')
for x in range(0,len(management_system)):
student = management_system[x]
if student['name'] == name:
print(student)
break
name = input('请输入姓名')
for i in range(0,len(management_system)):
student = management_system[i]
if student['name'] == name:
del management_system[i]
break
print(management_system)
for k in range(0,len(management_system)):
student = management_system[k]
print(k,student)
name1 = input('请输入姓名')
for j in range(0,len(management_system)):
student = management_system[j]
if student['name'] == name1:
student_averagescores = (student['english'] + student['pe'] + student['art'] + student['math']) / 4
print(student_averagescores)