(I'm very new to both python and stackoverflow.)
def A():
def B():
print("I'm B")
A.B = B
A()
A.B()
output:
"I'm B"
This works well. What I want is to put that in a class like this(doesn't work. I just tried..)
class Student:
def A(self):
def B():
print("I'm B")
self.A.B = B
I have no Idea how to make the class and how to call the sub function in the class.