Commit ddb059d2 by BellCodeEditor

auto save

parent 5ab88987
Showing with 23 additions and 5 deletions
score = {'语文':91,'数学':88,'英语':85}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
score = {
'悟空':{'语文':91,'数学':88,'英语':85},
'诺依':{'语文':99,'数学':96,'英语':95},
'豆豆':{'语文':91,'数学':90,'英语':90},
'郭晨琳':{'语文':99.5,'数学':100,'英语':100},
}
while True:
print('请输入你丫查询的名字,退出请按m')
str=input("名字")
print('*'*60)
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
if str in score:
m=score[str]
print(str+"同学的成绩如下:")
for k,v in m.items():
print(k,v)
print('*'*60)
elif str=='m' :
break
else:
print("提示:查询错误,请输入正确的名字")
print('*'*60)
\ 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