class a:
def __init__(self):
b
def c(self):
d(e)
def d(self,g):
print 1
I'm wondering what I should do if I want to use function d in function c as it turns that "global name d is not defined.". Thank you.
d is an instance method, so you call it using self.d().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With