Commit 538e2d29 by BellCodeEditor

auto save

parent 6295fdde
def ac(): # 负责统计价格
def ac():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
...@@ -12,5 +13,17 @@ def ac(): ...@@ -12,5 +13,17 @@ def ac():
continue continue
else: else:
total.append(unit) total.append(unit)
print(total) # print(total)
ac() return total
# 计算价格
def sums(money): # 形式参数money
count = 0
for i in money:
count += i
return count
# 函数调用
# a = ac()
# b = sums(a) # 实际参数 a (来自统计价格的列表)
# print(b)
import func
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