I have a python module that contains code for generating a large array, and it contains multiple functions for doing this. This is how I have it right now:
var1 = 0
var2 = 0
var3 = 0
var4 = 0
var5 = 0
var6 = 0
def main():
foo()
moo(var1,var2)
noo(var6)
def foo():
Math using vars
def moo():
More math
def noo():
More math
However, I cannot use vars 1-6 without first defying them inside there respective functions, as it throws a "Referenced before assignment" exception. It seems the best way to do this would be to use global, but that seems heavily frowned upon. Why is global not recommended? Would it be acceptable to use it here? How else should I go about this?