Commit 62dd03fc by BellCodeEditor

save project

parent 5ab88987
Showing with 18 additions and 5 deletions
score = {'语文':91,'数学':88,'英语':85}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
s1 = {'语文':25,'数学':24,'英语':1.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999}
s2 = {'语文':10,'数学':50,'英语':40}
s3 = {'语文':100,'数学':100,'英语':100}
s4 = {'语文':0,'数学':0,'英语':0}
student={"我":s3,"爸爸":s2,"妈妈":s1,"俞老师":s4}
while True:
print("输入q退出")
name=input('请输入姓名')
print("~"*30)
if name =="q":
break
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