title: What is the difference between class and instance variables?
body: <p>What is the difference between class and instance variables in Python?</p>
  
  <pre><code>class Complex:
      a = 1
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Complex:
      def __init__(self):
          self.a = 1
  </code></pre>
  
  <p>Using the call: <code>x = Complex().a</code> in both cases assigns x to 1.</p>
  
  <p>A more in-depth answer about <code>__init__()</code> and <code>self</code> will be appreciated.</p>