Commit 426a3875 by BellCodeEditor

save project

parent 5ab88987
Showing with 21 additions and 2 deletions
score = {'语文':91,'数学':88,'英语':85} s1 = {'语文':79,'数学':"88+10",'英语':95}
s2 = {'语文':75,'数学':"98+10",'英语':91}
s3 = {'语文':71,'数学':"87+10",'英语':75}
s4 = {'语文':61,'数学':"88+10",'英语':75}
s5 = {'语文':87,'数学':"94+18",'英语':92}
s6 = {'语文':71,'数学':"88+20",'英语':75}
s7 = {'语文':81,'数学':"97+20",'英语':97}
score = {"1号":s1,"2号":s2,"3号":s3,"4号":s4,"5号":s5,"6号":s6,"7号":s7}
while True:
name = input("请输入查询学号,退出请按“q”:")
if name in score:
print('*'*50)
info = score[name]
for k,v in info.items():
print(k,v)
print('*'*50)
elif name=='q':
print("查询以退出。")
break
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 else:
print("输入错误,请重新输入!!!\n注意:只可查询1~7号的成绩,数字后请加‘号’!!!")
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