But why would you use a Global? Wouldn't Local be more appropriate? Would Local have the same result?
I can see what the example is doing, but I cant figure out why? When the function is called for the second time, why is the Global not reinitialised and set back to 1?
In my head, it the example should print 1, 2, 1, 2
So many questions...
I can see what the example is doing, but I cant figure out why? When the function is called for the second time, why is the Global not reinitialised and set back to 1?
In my head, it the example should print 1, 2, 1, 2
So many questions...