Commit d08def3d by BellCodeEditor

save project

parent 9bdd9c01
Showing with 15 additions and 3 deletions
def funcname():
falses=0
total=[]
while True:
unit=input('请输入单价(q退出):')
......@@ -8,10 +9,21 @@ def funcname():
try:
unit=int(unit)
except:
print('儿砸别闹,再瞎写小心出门遭雷劈!!!')
falses+=1
print('儿砸别闹,再瞎写小心出门遭雷劈!!!')
if falses>5:
print('sm东西别瞎写了!!!')
if falses>10:
print('程序被你给玩坏了')
exit()
else:
total.append(unit)
finally:
print('*'*30)
return total
print(funcname())
\ No newline at end of file
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