Commit e5bc25c1 by BellCodeEditor

save project

parent a3a66a45
Showing with 14 additions and 10 deletions
...@@ -8,12 +8,16 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -8,12 +8,16 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
name=input('你叫什么名字') name=input('你叫什么名字')
if name=='悟空': while True:
for a,v in student1.items(): if name not in score:
print(a,v) print('输入名字不对,请重新输入')
if name=='诺伊': if name=='悟空':
for a,v in student2.items(): for a,v in student1.items():
print(a,v) print(a,v)
if name=='小贝': if name=='诺伊':
for a,v in student3.items(): for a,v in student2.items():
print(a,v) print(a,v)
\ No newline at end of file if name=='小贝':
for a,v in student3.items():
print(a,v)
name=input('你叫什么名字')
\ 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