Commit 9c2f5493 by BellCodeEditor

auto save

parent f0c715f8
Showing with 22 additions and 0 deletions
#创建存储成绩的字典
student1 = {"语文":91,"数学":99,"英语":60}
student2 = {"语文":92,"数学":99,"英语":60}
student3 = {"语文":93,"数学":99,"英语":60}
#创建学员名称字典
score = {'悟空':student1,"诺伊":student2,"小贝":student3}
#循环遍历
while True:
print("请输入要查询的名字,退出请输入1")
name = input("请输入你的名字:")
print("*"*30)
if name in score:
info = score[name]
for k,v in info.items():
print(k,v)
print("*"*30)
elif name=="1":
break
else:
print("输入有误,请重新输入!")
print('*'*30)
print("程序结束!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment