e是个啥
try:
int("var")
except ValueError as e:
print(type(ValueError))
print(type(e))
print(ValueError)
print(e)
output:
<class 'type'>
<class 'ValueError'>
<class 'ValueError'>
invalid literal for int() with base 10: 'var'
e是个啥
try:
int("var")
except ValueError as e:
print(type(ValueError))
print(type(e))
print(ValueError)
print(e)
output:
<class 'type'>
<class 'ValueError'>
<class 'ValueError'>
invalid literal for int() with base 10: 'var'
异常处理里固定用法,主要就是能将后面的异常信息输出出来而已