Commit b9e11b5b by BellCodeEditor

auto save

parent 1372a3f9
Showing with 17 additions and 11 deletions
...@@ -4,16 +4,22 @@ student3 = {'语文': 10, '数学': 80, '英语': 13} ...@@ -4,16 +4,22 @@ student3 = {'语文': 10, '数学': 80, '英语': 13}
score = {'悟空': student1, '诺依': student2, '小贝': student3} score = {'悟空': student1, '诺依': student2, '小贝': student3}
name = input("名字:") while True:
if name in score: name = input("名字:")
print("wow " * 25) if name in score:
info = score[name] print("press 'q' to end code")
for a,b in info.items(): print("wow " * 25)
print(a,b) info = score[name]
print("wow " * 25) for a,b in info.items():
else: print(a,b)
print('!' * 50) print("wow " * 25)
print("wrong name!") continue
print('!' * 50) elif name == "q":
break
else:
print('!' * 50)
print("wrong name!")
print('!' * 50)
print("end code")
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
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