May-25-2022, 02:31 PM
Hi all,
A general outline of my program could be written as something like this:
If I were to do such a thing, how would I handle variable scope? The variables reset in the function need to be available throughout the main program.
Finally, do you think this is even worth doing?
I have ~50 variables in this program and maybe 30 would be reset as part of the function.
A general outline of my program could be written as something like this:
Variable initiation (reset)
Control branch A
if...
elif...
elif...
else...
...
Variable reset
Control branch B
if...
elif...
else...
...
Variable resetVariable initiation and reset simply assign particular variables to 0, empty lists, etc. Because it's done in multiple places, I'm thinking about creating a user-defined function where the variables common to all three places are reset to 0.If I were to do such a thing, how would I handle variable scope? The variables reset in the function need to be available throughout the main program.
Finally, do you think this is even worth doing?
I have ~50 variables in this program and maybe 30 would be reset as part of the function.
