pytest常见的异常处理方法
具体内容需要二次学习,课程里面只提及两种处理方式。

try except例子:
try:
a = int(input())
b = int(input())
c = a/b
except ZeroDivisionError as e:
print("cannot be zero")
具体内容需要二次学习,课程里面只提及两种处理方式。

try except例子:
try:
a = int(input())
b = int(input())
c = a/b
except ZeroDivisionError as e:
print("cannot be zero")