Commit b452f259 by BellCodeEditor

save project

parent 8024ec0f
Showing with 9 additions and 3 deletions
...@@ -2,10 +2,16 @@ score1 = {'语文':91,'数学':78,'英语':79} ...@@ -2,10 +2,16 @@ score1 = {'语文':91,'数学':78,'英语':79}
score2 = {'语文':100,'数学':91,'英语':89} score2 = {'语文':100,'数学':91,'英语':89}
score3 = {'语文':80,'数学':99,'英语':100} score3 = {'语文':80,'数学':99,'英语':100}
student = {'悟空':score1,'诺伊':score2,'小贝':score3} student = {'悟空':score1,'诺伊':score2,'小贝':score3}
#****************************************************************
input("请输入需要查询的名字,退出请输入:q")
name = input("查询名字:") name = input("查询名字:")
info = student[name] print("*" * 30)
for k,v in info.items(): if name in student:
print(k,v) info = student[name]
for k,v in info.items():
print(k,v)
print("*" * 30)
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 # 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
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