Commit cd680f1b by BellCodeEditor

save project

parent 9ed2f357
Showing with 15 additions and 11 deletions
......@@ -8,16 +8,20 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# a=score[name]
# for k,v in a.items():
# print(k,v)
# # 查询并打印出输入的名字对应的所有科目的成绩
name=input("你的名字是什么?:")
print('*'*30)
if name in score:
score=score[name]
for k,v in score.items():
print(k,v)
# # 查询并打印出输入的名字对应的所有科目的成绩while True()
while True:
print("请您输入要查询的名字,退出请按2")
name=input("你的名字是什么?:")
print('*'*30)
else:
print("未查询到用户名,请输入正确的名字")
if name in score:
info=score[name]
for k,v in score.items():
print(k,v)
print('*'*30)
elif name=="2":
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