Commit b09847fc by BellCodeEditor

save project

parent 6f8db381
Showing with 20 additions and 5 deletions
def sy():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
un= input("请输入:")
if un== 'q':
break
else:
total.append(unit)
try:
un=int(un)
except:
print('请重新输入一个数字')
else:
total.append(un)
print('-'*30)
print(total)
sy()
\ No newline at end of file
return total
def sum(u):
c=0
for a in u:
c=c+a
return c
r=sy()
pay = sum(r)
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