Here is an extract of a script I've written:
succ_count = 0
def run_copy():
shutil.copy(file, 'W://20' + year + '/' + foldername + '/')
global succ_count
succ_count += 1
A colleague of mine said that the use of global variables here is bad.
I can see how it's inconvenient because I have to use global succ_count
before I increment it by one.
But why is the use of globals considered bad programming?
Apologies if this a very obvious question, I am relatively new to Python and trying to understand things as much as possible.