Commit efcbd5e3 by BellCodeEditor

save project

parent 7ff81d63
Showing with 11 additions and 3 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入money(q退出):") unit= input("请输入money(q退出):")
if unit== 'q': if unit== 'q':
break break
else: else:
...@@ -15,5 +15,12 @@ def new_input(): ...@@ -15,5 +15,12 @@ def new_input():
finally: finally:
print('-'*30) print('-'*30)
print(total) return total
new_input() def sum(m):
count=0
for i in m:
count+=i
return count
price = new_input()
pay = sum(price)
print(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