Commit 94b77d17 by BellCodeEditor

auto save

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