Commit 8d0c9371 by BellCodeEditor

save project

parent 3ce23feb
Showing with 10 additions and 3 deletions
...@@ -6,6 +6,12 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -6,6 +6,12 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
name = input("请输入要查询成绩学生的名字") name = input("请输入要查询成绩学生的名字")
for k,v in score[name].items(): #判断name在不在字典中,如果在字典中才打印,不在的话打印:名字错误,请重新输入
print(k) # for k,v in info.items():
print(v) # print(k)
# print(v)
print("*"*30)
if name in score:
info = score[name]
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