title: Python Inheritance error (with private variables)
body: <p>I'm a beginner at coding and tried looking up the error but could not find why it showed up. Could someone please explain it to me?</p>
  <p>My code as follows is:</p>
  <pre><code>class Automobile: 
      __material = None
      __height = None
      __width = None
      __engine_size = None  
  
      def set_values(self, mat, height, width, engsz=&quot;M&quot;): 
          self.__material = mat
          self.__height = height
          self.__width = width
          self.__engine_size = engsz 
      
      def getMat(self):
          return self.__material
      def getHeight(self):
          return self.__height
      def getWidth(self): 
          return self.__width
      def getEngineSize(self): 
          return self.__engine_size
  
  class Car(Automobile): 
      __pricePU = None
  
      def __findPricePerUnit(self):
          return priceDict[self.getMat] 
      def price(self): 
          return self.getWidth * self.getHeight * self.__findPricePerUnit
  
  print(&quot;A new car is being made&quot;)
  print(&quot;What are the dimensions wanted for the new car in&quot;)
  mat = input(&quot;Enter material: &quot;) 
  height = input(&quot;Enter height: &quot;)
  width = input(&quot;Enter width: &quot;)
  car1 = Car() 
  car1.set_values(mat, height, width)
  print(&quot;A new car has been made!&quot;)
  print(&quot;The price of this new car is: &quot;)
  print(car1.price)
  </code></pre>
  <hr />
  <p>My input for this is:</p>
  <pre class="lang-sh prettyprint-override"><code>iron=10,steel=20,gold=50,diamond=100
  gold
  1.5
  5
  </code></pre>
  <p>The OUTPUT shown at the end is:</p>
  <pre class="lang-py prettyprint-override"><code>A new car has been made!
  The price of this new car is:
  &lt;bound method Car.price of &lt;__main__.Car object at 0x0000025DE7E84C70&gt;&gt;
  </code></pre>
  <p>I am not exactly sure why this is coming up, could someone please explain this to me!</p>