Commit 94b77d17 by BellCodeEditor

auto save

parent 775bf4d4
import func
score=func.new_input()
number=func.sum(score)
print("游泳成绩一共得分:"+str(number))
def new_input(): #先 封装函数
total = []
while True:
......@@ -11,9 +12,16 @@ def new_input(): #先 封装函数
print("需要填入数字。")
else:
total.append(unit)
return tatol
print(total)
return total
def sum(money):
count=0
for i in money:
count = count + i
return count
#result=new_input()
#无参 #后 调用函数
result=new_input()
print(result)
\ No newline at end of file
#pay=sum(result)
#print("你需要支付"+str(pay)+"元。")
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