title: Python changing class variables
body: <p>Okay, I'll try and be extremely clear this time.</p>
  
  <pre><code>class Yes:
  
      def __init__(self):
          self.a=1
  
      def yes(self):
          if self.a==1:
              print "Yes"
          else:
              print "No, but yes"
  
  class No(Yes):
  
      def no(self):
          if self.a==1:
              print "No"
          else:
              print "Yes, but no"
          self.a-=1 #Note this line
  </code></pre>
  
  <p>Now, while running:</p>
  
  <pre><code>Yes().yes()
  No().no()
  Yes().yes()
  No().no()
  </code></pre>
  
  <p>I want it to print out:</p>
  
  <pre><code>Yes
  No
  No, but yes
  Yes, but no
  </code></pre>
  
  <p>It gives me:</p>
  
  <pre><code>Yes
  No
  Yes
  No
  </code></pre>
  
  <p>Now, I know the reason why is because I'm only changing the value of Self.a in the No class(Remember that line?). I want to know if there is anyway to change it in the Yes class while still in the No class (like if there was something that I could plug in in place of the self.a-=1 that would work).</p>