Commit b4d6107c by BellCodeEditor

save project

parent a7713e52
Showing with 29 additions and 21 deletions
total = [] def new_input():
while True: total = []
if unit== 'q': while True:
unit= input("请 unit = input('请输入(q退出):')
break if unit == 'q':
else: break
total.append(unit) else:
print(total) try:
def sum(money): unit = int(unit)
count = 0 except:
for i in money: print("请重新输入一个数字")
count = count + i else:
return count total.append(unit)
finally:
print("=====================")
price = new_input() return total
pay = sum(price)
print("您一共消费了" + str(pay) + "元!扫码还是现金呢?
def sum(money):
count = 0
\ No newline at end of file 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