Commit cf22e3fa by BellCodeEditor

save project

parent c885db28
Showing with 4 additions and 6 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:'p'") unit= input("请输入:(p退出)")
if unit== 'q': if unit== 'q':
break break
else: else:
...@@ -13,12 +13,10 @@ def new_input(): ...@@ -13,12 +13,10 @@ def new_input():
total.append(money) total.append(money)
finally: finally:
print("_"*30) print("_"*30)
print(total) return total
new_input() def sum(money):
return total
def sum(money)
count = 0 count = 0
for i in money: for i in money:
count = count + i count = count + i
return count return count
price = new_input() price = new_input()
......
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