title: How to define a variable of a class as class object in Python
body: <p>I need to define a variable of a class a class object. How can I do it?</p>
  <p>if for example I have a class like this :</p>
  <pre><code>class A:
    def __init__(self, a, b):
       self.a = a
       self.b = b
  </code></pre>
  <p>and I want to create another class B that have a variable as instance of class A like :</p>
  <pre><code>class B:
    def __init__(self, c = A(), d):
       self.c = c
       self.d = d 
  </code></pre>
  <p>How can I do it ? I need to do particular operation or simply declarate c as object of class A when I create the object of class B ?</p>