Commit c5fd6594 by BellCodeEditor

save project

parent 2cb8492b
Showing with 12 additions and 7 deletions
score = {'语文':91,'数学':88,'英语':85}
s1 = {'语文':20,'数学':40,'英语':14}
s2 = {'语文':96,'数学':100,'英语':100}
s3 = {'语文':4,'数学':7,'英语':5}
student= {"买买买":s1,"好几家":s2,"导弹王":s3}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
for k,v in score.items():
print(k,v)
\ No newline at end of file
name = input("请输入姓名:")
if name in student:
score = student[name]
for k,v in score.items():
print(k,v)
else:
print("输入错误")
\ 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