zcgw.net
当前位置:首页 >> python3.x try ExCEpt >>

python3.x try ExCEpt

class Calculator(Exception): try: x = input('Enter the first number:') y = input('Enter the second number:') print(int(x)/int(y)) except ZeroDivisionError: print('The second number cannot be Zero') except ValueError: #int方法抛...

try: pass except KeyboardInterrupt as e: print(e) Python 3.x的Tools\Scripts目录下有一个实用工具叫2to3.py,可以在一定程度上协助将Python2中的代码移植到Python3中。

小电影?

网站首页 | 网站地图
All rights reserved Powered by www.zcgw.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com