I am trying to learn how to define a global variable inside a function that is located in my locally created library .
I am working on a project of mine and I came up with a problem.
I am trying to progress my counter variable by using a global variable inside my function, it have worked totally fine (while all my functions were defined inside my main program ) until I have created my own library and transferred my functions there.
right now it approaches the function, runs it but give e the following error :
NameError: name ‘StepCounter’ is not defined
(StepCounter is defined inside the main program. it is defined as a global variable inside the function)
Mati76 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.