Commit 37e3e6a2 by BellCodeEditor

save project

parent a888b304
Showing with 10 additions and 5 deletions
......@@ -3,8 +3,13 @@ s2 = {'语文':90,'数学':99,'英语':96}
s3 = {'语文':86,'数学':76,'英语':82}
score = {'悟空':s1,'曹煜临':s2,'小贝':s3}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出
name=input("请输入您的名字")
a=score[name]
for k,v in a.items():
print(k,v)
while True:
name=input("请输入您的名字,输入q退出")
if name in score:
a=score[name]
for k,v in a.items():
print(k,v)
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