Commit 58d5c8ca by BellCodeEditor

auto save

parent 5e62afb0
import func
print(func.mysum(func.func()))
try:
unit=3/0
except Exception:
print(type(Exception))
\ No newline at end of file
...@@ -5,5 +5,15 @@ def func(): ...@@ -5,5 +5,15 @@ def func():
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
print(total) unit=int(unit)
except:
print('输入错误')
else:
total.append(unit)
return total
def mysum(money):
total = 0
for i in money:
total += i
return 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