python 之 assert断言

用法:assert + 判断语句

返回:判断语句为真,程序继续执行;为假,抛出错误

>>a = 1
>>b = 2
>>assert a == b 
#判断语句为假,抛出错误,若为真,则程序不输出其他东西
    AssertionError

#image[..., 1]相当于image[:, :, 1]维度任意大小

猜你喜欢

转载自blog.csdn.net/weixin_42338058/article/details/84026476