Commit 3e78aa94 by BellCodeEditor

save project

parent 5ab88987
Showing with 17 additions and 2 deletions
score = {'语文':91,'数学':88,'英语':85}
sb ={'语文':2,'数学':2,'英语':3}
sq={'语文':2,'数学':2,'英语':3}
sg={'语文':2,'数学':2,'英语':3}
score = {'校长':sb,'老师':sq,'俞老师':sg}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
while True:
print("如需退出请按Q")
name =input("请输入要查询的姓名:")
if name in score:
info =score[name]
print("~"*33)
for k,v in info.items():#values()值 keys()
print(k,v)
print("~"*33)
elif name=='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