Commit 1c546be3 by BellCodeEditor

save project

parent f0c715f8
Showing with 28 additions and 0 deletions
student1 = {'语文': 222, '数学': 230, '英语': 250,'总分':702}
student2 = {'语文': 2, '数学': 1, '英语': 500,'总分':503}
student3 = {'语文': 229, '数学': 234, '英语': 250,'总分':713}
score = {'哈利随便': student1, '马粪随便': student2, '赫敏小仙女': student3}
# 查询并打印出输入的名字对应的所有科目的成绩
while True :
print("请输入大才子的大名,退出q")
name = input("姓名:")
print("*" * 30)
if name in score :
info = score[name]
for k,v in info.items():
print(k,v)
print('*'*30)
elif name == "q":
break
else:
print("错误,重新输入")
print('*'*30)
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