Commit 9777c927 by BellCodeEditor

auto save

parent dc70412a
def a():
total = 0
total1=[]
while True:
unit=input("请输入单价:")
if unit=='q':
break
else:
try:
unit=int(unit)
except:
print('请输入整数!')
else:
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:
# print('qqq')
# print('aaa')
\ No newline at end of file
import func
print('qqq')
\ 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