Commit cb1b77e5 by BellCodeEditor

save project

parent dc70412a
Showing with 30 additions and 0 deletions
def funcname():
falses=0
total=[]
while True:
unit=input('请输入单价(q退出):')
if unit=='q':
break
else:
try:
unit=int(unit)
except:
falses+=1
print('儿砸别闹,再瞎写小心出门遭雷劈!!!')
if falses>5:
print('sm东西别瞎写了!!!')
if falses>10:
print('程序被你给玩坏了')
exit()
else:
total.append(unit)
finally:
print('*'*30)
return total
def add(l):
count=0
for i in l:
count+=i
return count
print('一共'+add(funcname())+'元。')
\ 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