Commit c2b08f77 by BellCodeEditor

save project

parent 5f05719c
Showing with 15 additions and 7 deletions
...@@ -7,11 +7,19 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -7,11 +7,19 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
name=input('姓名:') while True:
if name in score: name=input('姓名:')
score[name] print('退出按q')
for q,w in score[name].items(): print('*'*8)
print(q,w) if name in score:
else: score[name]
print('名字不存在') for q,w in score[name].items():
print(q,w)
elif name=='q':
break
else:
print('名字不存在')
print('*'*8)
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