Commit 24ebb4ed by BellCodeEditor

save project

parent b29f9747
Showing with 7 additions and 5 deletions
...@@ -9,11 +9,13 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -9,11 +9,13 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
#for k,v in score.items(): #for k,v in score.items():
name=input("姓名") name=input("姓名")
q=score[name] if name in score:
a=input("学科") q=score[name]
s=q[a] a=input("学科")
print(s) s=q[a]
print(s)
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