Commit 662780e3 by BellCodeEditor

save project

parent f2f37b12
Showing with 13 additions and 9 deletions
...@@ -7,11 +7,15 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -7,11 +7,15 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
name = input("请输入你的名字:") while True:
if name in score: name = input("查询成绩,请输入你的名字,退出查询请按a:")
a=score[name] if name in score:
print("*"*30) a=score[name]
for i,o in a.items(): print("*"*30)
print(i,o) for i,o in a.items():
else: print(i,o)
print("巡查错误,请输入正确的名字:") elif name=="a":
\ No newline at end of file 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