Commit 678888fa by BellCodeEditor

save project

parent c557bca6
Showing with 20 additions and 3 deletions
......@@ -7,7 +7,23 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩
name = input('名字')
info = score[name]
for k,v in info.items():
#
while True:
name = input('请输入您想查询的名字:')
print('*' * 30)
if name in score:
info = score[name]
for k,v in info.items():
print(k,v)
print('*' * 30)
print("是否继续查询?")
cxzt = input('是 否:')
if cxzt =='是':
continue
else:
break
else:
print("对不起!您所查询的名字不在成绩单中,请重新输入!")
print('*' * 30)
continue
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