美文网首页
023 Python语法之断言

023 Python语法之断言

作者: Luo_Luo | 来源:发表于2017-09-12 11:13 被阅读0次

    assert 关键字

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

    assert的用法

    assert bool ,"提示语"
    
    assert 1 != 1, "脑子进水了"
    

    相关文章

      网友评论

          本文标题:023 Python语法之断言

          本文链接:https://www.haomeiwen.com/subject/lfccsxtx.html