M
mitsura
Hi,
I just started with Python and I am new to OO programming.
Here is a simple code:
"
class Obj:
myVar = 1
def __init__(self):
myVar = 2
#
myObj = Obj()
print myObj.myVar
"
The output is of this script is '1'. I would except it to be '2'.
I not understanding something fundamentally here.
Can anybody explain?
With kind regards,
Kris
I just started with Python and I am new to OO programming.
Here is a simple code:
"
class Obj:
myVar = 1
def __init__(self):
myVar = 2
#
myObj = Obj()
print myObj.myVar
"
The output is of this script is '1'. I would except it to be '2'.
I not understanding something fundamentally here.
Can anybody explain?
With kind regards,
Kris