I want to have 2 global arrays for results
global_array1 = []
global_array2 = []
In my function, I will add value to different array depends on condition:
def myfunc():
global global_array1:
global global_array2:
result =[]
for a in anArray:
if some_condition == True:
result = global global_array1
else
result = global_array2
# do something hhere
result.append(aResult)
But when I try it, I don't see myFunction is saving result to the global array. How can I make 'result' as a pointer to either of my global_array1 or global_array2?
global blobal_array1etc. Also,result = global global_array1is a SyntaxError as well.