I want to make a function, in which I can address one of global variables using function parameter.
For example I want this code to print 6 and 10:
foo = 1
foofoo = 7
def bar(x, y):
x += y
bar(foo, 5)
print(foo)
bar(foofoo, 3)
print(foofoo)
I looking for that to shorthen my code, 'cause I don't want to make 5 different functions to make 5 variables go through the same code segment depending on which I need in that moment. Is there any simple way to solve that problem?