Commit 3182aeff by BellCodeEditor

save project

parent 2a859e6d
Showing with 11 additions and 3 deletions
import import time
print("欢迎使用查询总分系统!") print("欢迎使用查询总分系统!")
time.sleep(1)
a=input("请输入您的总分:") a=input("请输入您的总分:")
time.sleep(1)
print("查询中···")
time.sleep(3)
print("您的总分是"+a+"!")
\ No newline at end of file
...@@ -5,7 +5,7 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3} ...@@ -5,7 +5,7 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# info=score['悟空'] # info=score['悟空']
# for k,v in info.items(): # for k,v in info.items():
# print(k,v) # print(k,v)
b=0
# 查询并打印出输入的名字对应的所有科目的成绩 # 查询并打印出输入的名字对应的所有科目的成绩
while True : while True :
...@@ -18,8 +18,9 @@ while True : ...@@ -18,8 +18,9 @@ while True :
a = score[name] a = score[name]
print('*'*30) print('*'*30)
for k,v in a.items(): for k,v in a.items():
b+=v
print(k,v) print(k,v)
break print("您的总分是"+str(b)+"分!")
else: else:
print('输入错误') print('输入错误')
continue continue
\ 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