Commit 8460d480 by BellCodeEditor

save project

parent 05e7d622
total = []
def new_input():
while True:
unit= input("请输入分数(q退出):")
if unit== 'q':
break
else:
try:
int(unit)
except:
print('要输入整数啊~~~')
else:
total.append(unit)
return unit
new_input()
count=0
for i in total:
count=count+int(i)
print(count)
\ No newline at end of file
import func
func.new_input()
count=0
for i in total:
count=count+int(i)
print("这位选手的总分数为"+count+"分")
\ 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