title: how to send value in a function inside a class to a function in another class
body: <p>This question was assumed to be a duplicate but it is not. The suggested answer does not work. this was the suggested answer, <a href="https://stackoverflow.com/questions/10139866/calling-variable-defined-inside-one-function-from-another-function">Calling variable defined inside one function from another function</a></p>
  <p>below are two classes base_step and logoclick_step.</p>
  <p>In the function inside base_step (login), there is a variable 'z'.</p>
  <p>Now how do I access this 'z' value inside 'admin' function of logoclick_step.</p>
  <p>The below code returns the following error.</p>
  <blockquote>
  <p>a = a+z NameError: name 'z' is not defined</p>
  </blockquote>
  <pre><code>class base_step:
      a = 15 
      def login(self):
          z = 110000000
          print(&quot;completed_login&quot;)
          return z
  
  
  
  class logoclick_step(base_step):
       
        def admin(a):
            a = a+z
            print(&quot;hello&quot;,  base_step.a)
            
  
        
  
  ls = logoclick_step()
  ls.login()
  ls.admin()
  </code></pre>