Commit 3feee75e by BellCodeEditor

save project

parent f0c715f8
Showing with 28 additions and 0 deletions
student1 = {'语文': 20, '数学': 50, '英语': 30}
student2 = {'语文': 100, '数学': 99.5, '英语': 100}
student3 = {'语文': 99.5, '数学': 100, '英语': 99.5}
score = {'悟空': student1, '诺依': student2, '小贝': student3}
while True :
print('按"q"可滚')
name=input('名字:')
if name in score:
m=score[name]
print('*'*30)
for k,v in m.items():
print(k,v)
elif m=="q":
break
else:
print("滚")
# 查询并打印出输入的名字对应的所有科目的成绩
while True :
name = input("名字:")
if name in score :
a = score[name]
print('*'*30)
for k,v in a.items():
print(k,v)
break
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