Commit 587d7c90 by BellCodeEditor

auto save

parent b7498cbe
Showing with 50 additions and 14 deletions
student1 = {'语文': 91, '数学': 88, '英语': 85} # student1 = {'语文': 91, '数学': 88, '英语': 85}
student2 = {'语文': 97, '数学': 98, '英语': 90} # student2 = {'语文': 97, '数学': 98, '英语': 90}
student3 = {'语文': 95, '数学': 100, '英语': 93} # student3 = {'语文': 95, '数学': 100, '英语': 93}
score = {'悟空': student1, '诺依': student2, '小贝': student3} # score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # # 查询并打印出输入的名字对应的所有科目的成绩
while True : # while True :
name = input("名字:") # name = input("名字:")
if name in score : # if name in score :
a = score[name] # a = score[name]
print('*'*30) # print('*'*30)
for k,v in a.items(): # for k,v in a.items():
print(k,v) # print(k,v)
# break
# else:
# print('输入错误')
good1 = {'语文':13,'数学':14,'英语':11,'科学':13}
good2 = {'语文':113,'数学':114,'英语':111,'科学':113}
good3 = {'语文':123,'数学':124,'英语':121,'科学':123}
a={
'陈大':good1,
'陈二':good2,
'陈三':good3
}
while True:
name=input("输入姓名,按q退出")
if name=='q':
break break
elif name in a:
b=a[name]
print(name)
for i,v in b.items():
print(i,v)
else: else:
print('输入错误') print('输入错误')
\ No newline at end of file
# name=input('输入名字')
# if name in a:
# b=a[name]
# for i,v in b.items():
# print(i,v)
# else:
# 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