Commit 6d5a0f5b by BellCodeEditor

save project

parent b4cf11b8
Showing with 19 additions and 5 deletions
score = {'语文':91,'数学':88,'英语':85} student1={"语文":97,"数学":96,"英语":100}
for k,v in score.items(): student2={"语文":69,"数学":80,"英语":75}
print(k,v) student3={"语文":91,"数学":93,"英语":89}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 score={'悟空':student1,'诺伊':student2,'小贝':student3}
while True:
print('输入名字,退出请按q')
name=input('姓名:')
print('*'*30)
if name in score:
info=score[name]
for k,v in info.items():
print(k,v)
print('*'*30)
elif name == 'q':
break
else:
print('查询错误,重新输入')
print('*'*30)
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