Sorry if it’s dumb question, I am not a programmer. Just wanted to understand how global variables are handled in if elif statement. The global variable x (Boolean) may be updated elsewhere at high frequency So I need the x to be the same in both If and elif conditional statements. Does the underlying code use the same value of x in both statements or does it read the global variable each time, thus meaning it may be different in the two conditional statements?
Hope that makes sense?
E.g.
global x
if x and not status:
# Do some stuff
elif not x and status:
# do some other stuff
This is just a question trying to understand how global variables are handled