Commit 62cd45bc by BellCodeEditor

save project

parent 6551f765
...@@ -13,7 +13,7 @@ def new_input(): ...@@ -13,7 +13,7 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
return total return total
def sum(money): def sum(money):
count=0 count=0
for i in money: for i in money:
count=count + i count=count + i
...@@ -23,4 +23,4 @@ def new_input(): ...@@ -23,4 +23,4 @@ def new_input():
a = new_input() a = new_input()
b = sum(a) b = sum(a)
print("你消費了"+str(b)+"元") #print("你消費了"+str(b)+"元")
\ No newline at end of file \ No newline at end of file
import func
data = func.new_input()
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