Booleans in If Statements in Python

This question already has an answer here:

  • Using global variables in a function other than the one that created them 18 answers

  • The fragment

    def Startup():
        global PasswordSkip
    

    does not declare PasswordSkip to be global everywhere. It declares that within this function, references to setting PasswordSkip should be taken to be the global variable PasswordSkip rather than some local variable.

    Now in the function PasswordRemove , you do not declare that PasswordSkip is a global to be brought into scope. Thus statements like PasswordSkip = True are setting a local variable PasswordSkip

    链接地址: http://www.djcxy.com/p/23898.html

    上一篇: Python函数在模块名称空间中替换它自己

    下一篇: 布尔如果在Python中声明