Commit be1ef400 by BellCodeEditor

save project

parent 9f4b5032
Showing with 11 additions and 4 deletions
...@@ -4,7 +4,14 @@ student3 = {'语文': 95, '数学': 100, '英语': 93} ...@@ -4,7 +4,14 @@ student3 = {'语文': 95, '数学': 100, '英语': 93}
score = {'悟空': student1, '诺依': student2, '小贝': student3} score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
m=input("请输入学生名字或'q'退出") while True:
for a,b in m.items(): m=input("请输入学生名字或'q'退出:")
if m in score:
n=score[m]
for a,b in n.items():
print(a,b) print(a,b)
elif m=="q":
\ No newline at end of file print('程序已退出')
break
else:
print('您输入的名称不在')
\ No newline at end of file
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