Commit 24989c56 by BellCodeEditor

save project

parent e3f0ab47
Showing with 12 additions and 5 deletions
......@@ -4,9 +4,16 @@ student3 = {'语文': 95, '数学': 100, '英语': 93}
score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩
q=input("请输入名字")
if q in score:
print(score[q])
else:
print("输入有误")
while True:
print("退出输入q")
q=input("请输入名字")
if q in score:
n=score[q]
for k,v in n.items():
print(k,v)
elif q == 'q':
break
else:
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