Commit b67749da by BellCodeEditor

save project

parent dc70412a
def func():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit1=int(unit)
except:
print("输入整数")
else:
total.append(unit1)
return total
def sum(dd):
count=0
for i in dd:
count=count+i
return count
#p=sum(func())
#print(p)
\ No newline at end of file
import func
data=func.func()
score=func.sum(data)
print("选手的得分是"+str(score)+"分")
\ 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