I have this code:
class A():
def __init__(self):
self.new_list = ['one', 'two', 'three']
class B():
a = A()
def foo():
print(a.new_list)
When I type
b = B()
b.foo()
I get this error:
NameError: name 'a' is not defined
I don't understand why because I already created the object a
with the A()
class