0

I am trying to check if the user typed in the correct password if they did then I want to make a bool true but for some reason it's just declaring a new bool with the same name I have tried looking for other questions but none of them are in my situation


Correct = False

def SubmitPassword():
        if e6.get() == password:
                Correct = True```
Moomoo
  • 1
  • 3
  • Is there a specific reason you need global variables? Also, for the given code, e6 and password are not defined, so please show a [mcve] – OneCricketeer Nov 22 '20 at 05:31

2 Answers2

2
Correct = False

def SubmitPassword():
        global Correct
        if e6.get() == password:
                Correct = True```

try this code

sourab maity
  • 1,025
  • 2
  • 8
  • 16
0

Try using the not operator for doing this.So in your case it will be something like Correct= not Correct

Sreeram M
  • 140
  • 10