Sorry about not being so clear
my actual question goes this way
I define two functions
- def bar():
-
sum = 10 + i # the i should be from the function foo
-
i would not prefer to use the return function cause i am returning something else with it
to be more precise this is how i do it for a method variable
- >>> class a:
-
... def foo(self):
-
... self.i = 10
-
... self.i = self.i + 10
-
...
-
>>> obj = a()
-
>>> obj.foo()
-
>>> obj.i
-
20
i could manipulate the value of i using the class instance
similarly how do i do it for variables inside a function