not与逻辑判断句if连用,代表not后面的表达式为False的时候,执行冒号后面的语句。比如:
a = False
if not a:   (这里因为a是False,所以not a就是True)
    print "hello"

这里就能够输出结果hello

a = None同理

 

原文链接:https://blog.csdn.net/m0_37843198/article/details/78890523?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

相关文章:

  • 2021-06-08
  • 2022-02-18
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2018-03-26
猜你喜欢
  • 2022-12-23
  • 2021-06-29
  • 2021-08-21
  • 2021-11-16
  • 2021-07-18
  • 2022-03-04
相关资源
相似解决方案