Commit d08def3d by BellCodeEditor

save project

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