Commit 6b05c468 by BellCodeEditor

save project

parent 95c78709
Showing with 4 additions and 1 deletions
...@@ -4,7 +4,7 @@ student3 = {'语文': 95, '数学': 100, '英语': 93} ...@@ -4,7 +4,7 @@ student3 = {'语文': 95, '数学': 100, '英语': 93}
score = {'悟空': student1, '诺依': student2, '小贝': student3} score = {'悟空': student1, '诺依': student2, '小贝': student3}
while True: while True:
name = input("名字:") name = input("请输入要查询的名字(输入q退出程序):")
if name in score: if name in score:
info = score[name] info = score[name]
print("*" * 15) print("*" * 15)
...@@ -13,6 +13,9 @@ while True: ...@@ -13,6 +13,9 @@ while True:
print(k,v) print(k,v)
print("") print("")
print("*" * 15) print("*" * 15)
elif name == "q":
print("程序已退出!谢谢使用")
break
else: else:
print("*" * 15) print("*" * 15)
print("") 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