Commit c5692a07 by BellCodeEditor

auto save

parent 77b7c9c5
Showing with 10 additions and 6 deletions
def a():
total = []
total = 0
total1=[]
while True:
unit=input("请输入单价:")
if unit=='q':
print('现在总计为:'+str(total))
return unit
break
else:
try:
......@@ -12,15 +11,20 @@ def a():
except:
print('请输入整数!')
else:
total.append(int(unit))
total+=unit
total1.append(int(unit))
print('现在总计为:'+str(total))
print('各计单价为:'+str(total1))
finally:
print('-'*30)
print('总计为:'+str(total))
print('各计单价为:'+str(total1))
print('-'*30)
return total
while True:
a()
# try:
# age=int(input('www'))
# except:
......
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