能够实现多次查询成绩的程序
程序员文章站
2024-03-18 20:50:22
...
scores = [['迷途', 85], ['黑夜', 80], ['静怡', 90], ['小甲鱼', 67]]
running = True
have_find = 0
while running:
name = input('请输入您要查询的姓名:')
for each in scores:
if name in each:
print(name + '的成绩是 %d ' % each[1])
running = False
have_find = 1
break
if have_find == 0:
print('查不到此人的成绩,请重新输入姓名!')
continue