Commit 2aa82578 by BellCodeEditor

save project

parent a85be29d
import func
data = func.new_input()
score=func.sum_price(data)
print("总分"+str(score))
...@@ -12,13 +12,10 @@ def new_input(): ...@@ -12,13 +12,10 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
return total return total
total = new_input()
print(total)
def sum_price(price_list): def sum_price(price_list):
sums = 0 sums = 0
for i in price_list: for i in price_list:
sums = sums+i sums = sums+i
return sums return sums
cost = sum_price(total)
print("总价",cost)
\ 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