class test1:
def __init__(self):
pass
def test1_1(self):
self.a = 0
print(self.a)
class test2:
def __init__(self):
pass
def test2_2(self):
self.aaa = test1()
self.aaa.a = 9999999999
print(self.aaa)
test1().test1_1()
test2.test2_2()
I want to put 999999999999999 in the value of 'self.a' in the code, but I don't know how to do it
I'm curious. Is there a simple way to put it in, not a complicated task like class dependency?
If you are inheriting, you can immediately access the instance variable.
Please refer to the notebook below.
https://notebooks.azure.com/wincommerce/projects/hashcode/html/7988.ipynb
© 2024 OneMinuteCode. All rights reserved.