print('你已经成功录入了一份信息,继续录入请按Y,返回菜单请按N')
exit = input()
if exit == 'y':
continue
else:
break
while int(order) == 2:
name = input("请输入你要查找的学生的姓名:")
n += 1
if n > 2:
print('你已经重复输错三次,请确认姓名再进行查询操作')
n = 0
continue
t_name = 0#输入正确标志位
for sname in student:
if name == sname['姓名']:
print('该同学的记录是:',sname)
#print('%s同学的记录是:学号%s 班级%s 语文%.2f 数学%.2f 英语%.2f 物理%.2f 化学%.2f 生物%.2f '
#'加权总分%.2f' % (name,sname['学号'],sname['班级'],sname['语文'],sname['数学'],sname['物理'],sname['化学'],sname['生物'],sname['加权总分']))
t_name = 1
break
if t_name == 0:
exit = input('查询错误,请重确认要查询的学生姓名,退回主菜单请按N')
if exit == 'n':
break
continue
else:
exit = input('查询成功,输入名字继续查询,退回主菜单请按N')
if exit == 'n':
break
continue
while int(order) == 3:
name = input("请输入你要修改信息的学生的姓名:")
t_name = 0 # 输入正确标志位
for sname in student:
if name == sname['姓名']:
id = input('请输入学生号:')
classid = input('请输入学生的班级:')
Chinese = float(input('请输入语文成绩:'))
Math = float(input('请输入数学成绩:'))
English = float(input('请输入英语成绩:'))
Physical = float(input('请输入物理成绩:'))
Chemistry = float(input('请输入化学成绩:'))
Biological = float(input('请输入生物成绩:'))
Score = round(
(Chinese * 3 + Math * 3 + English * 3 + Physical * 2 + Chemistry * 2 + Biological * 2) / 15, 2)
grade['姓名'] = name
grade['学号'] = id
grade['班级'] = classid
grade['语文'] = Chinese
grade['数学'] = Math
grade['英语'] = English
grade['物理'] = Physical
grade['化学'] = Chemistry
grade['生物'] = Biological
grade['加权总分'] = Score
t_name = 1
break