I have this project, in which I have a single counter, which counts throughout the whole program. I have several functions, in which this counter appears. The problem is, how do I get the counter value from another function?
The situation is pretty much like this. The counter already has a previous value:
def function1(counter):
if logic:
function2(counter)
print("...", counter, "...")
# following code
# function1 should continue with the updated counter value
def function2(counter):
while logic1
if logic2
counter += 1
Et cetera. I hope you understood.