Commit 37a0c383 by BellCodeEditor

save project

parent 2592f6c8
Showing with 10 additions and 1 deletions
...@@ -11,6 +11,14 @@ def new_input(): ...@@ -11,6 +11,14 @@ def new_input():
print("输入有误!请重新输入。") print("输入有误!请重新输入。")
else: else:
total.append(unit) total.append(unit)
finally:
print("-"*30) print("-"*30)
return total return total
new_input() def sum(money):
count = 0
for i in money:
count = count + i
return count
price = new_input()
pay = sum(price)
print("宁一共消费了" + str(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