023 Python语法之断言

assert 关键字

  1. 第一个参数为断言的判断
  2. 第二个参数为错误提示语

assert的用法

assert bool ,"提示语"

assert 1 != 1, "Wrong"
发布了151 篇原创文章 · 获赞 26 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/runnoob_1115/article/details/102697157