Commit 0c0bf15b by BellCodeEditor

save project

parent 5ab88987
Showing with 18 additions and 4 deletions
score = {'语文':91,'数学':88,'英语':85} s1 = {'语文':60,'数学':10,'英语':8}
s2 = {'语文':0,'数学':1,'英语':0}
s3 = {'语文':333,'数学':333,'英语':0}
score={"悟空":s1,"俞老师":s2,"林钰翔":s3}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 # 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
while True:
print("如需退出请按q")
name=input("请输入要查询的姓名")
if name in score:
info=score[name]
print("~"*10)
for k,v in info.items(): #values() 值 keys() 键
print(k,v)
print("~"*10)
elif name=="q":
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