+ 1
what's the error?
2 Antworten
+ 6
if you want to change the global variable inside the function then you have to define the global variable first inside the function
Example:
state = False
def makeTrue():
global state
state = True
# call function...
makeTrue()
print(state)
# true
0
ferdiansyah0611 Thanks mate!