class A: def __init__(self): pass def getY(self): self.y = 3 return self.y def test(): a = A() y = a.getY() print(y) test()
def num1():
y=3;
return y;
self.z = self.x + num1();