Commit 7935aef6 by BellCodeEditor

auto save

parent 5ab88987
Showing with 21 additions and 5 deletions
score = {'语文':91,'数学':88,'英语':85} s1 = {'语文':91,'数学':88,'英语':85}
s2= {'语文':34,'数学':30,'英语':0}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 s3= {'语文':85,'数学':95,'英语':95}
s4= {'语文':99,'数学':100,'英语':100}
s={'a':s1,'b':s2,'c':s3,'d':s4}
while True:
p=input('您想查询哪个同学的成绩,退出请按U键')
print('*'*28)
if p=='U':
print('谢谢您的查询')
break
else:
if p in s:
o=s[p]
print('*'*28)
for k,v in o.items():
print(k,v)
print('*'*28)
else:
print('您查询的名字不存在,请输入正确的名字')
print('*'*28)
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