Commit d3f62b30 by BellCodeEditor

save project

parent e9b73f58
Showing with 4 additions and 5 deletions
def a(): def a():
total = [] total = []
while True: while True:
try: try:
unit=int(input("请输入单价:")) unit=float(input("请输入单价:"))
except: except:
print('请输入整数!') print('请输入整数!')
else: else:
if unit == 'q': if unit == 'q':
break break
else: else:
total.append(int(unit)) total.append(float(unit))
# total[0]=total[0]+unit # total[0]=total[0]+unit
print('现在总计为:'+str(total)) print('现在总计为:'+str(total))
......
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