点击查看【bilibili】

    逻辑运算符:
    image.png

    代码学习:

    1. a = 0
    2. b = 1
    3. c = 2
    4. # 1. and "与" 都真才真
    5. print(b>a and c>b)
    6. print(b<a and c>b)
    7. # 2. or “或” 遇真才真,都假才假
    8. print(b>a or c>b)
    9. print(b<a or c>b)
    10. # 3. not 取反
    11. print(not False)
    12. print(not c>b)

    运行结果如下:
    image.png