Commit 15308f38 by BellCodeEditor

auto save

parent b7498cbe
Showing with 11 additions and 18 deletions
student1 = {'语文': 91, '数学': 88, '英语': 85} s={"语文":90,"数学":91,"英语":99,"科学":92,"体育":10}
student2 = {'语文': 97, '数学': 98, '英语': 90} s2={"语文":92,"数学":89,"英语":89,"科学":95,"体育":80}
student3 = {'语文': 95, '数学': 100, '英语': 93} s3={"语文":95,"数学":97,"英语":94,"科学":97,"体育":90}
score = {'悟空': student1, '诺依': student2, '小贝': student3} name={"孙凯瑞":s,"小明":s2,"小红":s3}
while True:
c=input("请输入名字")
d=name[c]
if c in name:
# 查询并打印出输入的名字对应的所有科目的成绩 for k,v in d.items():
while True :
name = input("名字:")
if name in score :
a = score[name]
print('*'*30)
for k,v in a.items():
print(k,v) print(k,v)
break
else: else:
print('输入错误') print("名字错了")
\ No newline at end of file continue
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