Commit 810ff9d1 by BellCodeEditor

save project

parent 05e7d622
def newinput():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
return total
break
else:
try:
total.append(int(unit))
except:
print("运行错误,请重新输入")
def sum(m):
price=0
for i in m:
price=price+i
return price
import func
data=func.newinput()
num=func.sum(data)
print("该选手的总分是"+str(num)+"分")
\ 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