x = 5 def bar(x,y): y[0] = y[0] * x return x, x def foo(x): x = x + 2 y = [x] bar(x, y) return x, y[0] x,y = foo(x) print(x,y)