Commit acc993d0 by BellCodeEditor

save project

parent b8a2b536
Showing with 11 additions and 6 deletions
...@@ -7,9 +7,14 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -7,9 +7,14 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
a=input("你的名字:") while True:
if a in score: a=input("你的名字:")
for k,l in score[a].items(): print("*"*30)
print(k,l) if a in score:
else: for k,l in score[a].items():
print("这里没有该名字。") print(k,l)
print("*"*30)
elif a == '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