title: Problems with inheriting the correct property with the child class in python
body: <p>I am needing to have the child class inherit from the parent class. I continue to either get &quot;TypeError: <strong>init</strong>() missing 1 required positional argument: 'species'&quot; or the name is often getting assigned to the name and name continues to return back as none.</p>
  <pre><code>import unittest
  import time
  
  class Mammal:
     &quot;&quot;&quot; A Mammal class to further populate our animal kingdom &quot;&quot;&quot;
  
     def __init__(self, species, name):
         &quot;&quot;&quot; mammal constructor can initialize class attributes &quot;&quot;&quot;
         self.species = species
         self.name = None
  
     def eat(self, food):
         &quot;&quot;&quot; a method that will 'eat' in O(n) time &quot;&quot;&quot;
         i = food
         print(self.name, &quot;the&quot;, self.species, &quot;is about to eat&quot;)
         while i &gt;= 1:
             time.sleep(0.1)
             i = i // 2
         print(&quot;    &quot;, self.name, &quot;is done eating!&quot;)
  
     def makeNoise(self):
        &quot;&quot;&quot; a method that should be implemented by children classes &quot;&quot;&quot;
        raise NotImplementedError(&quot;this method should be implemented by child class&quot;)
  </code></pre>
  <p>ADD ANY OTHER BASE CLASS METHODS YOU NEED/WANT TO HERE</p>
  <pre><code>def __eq__(self, object):
     return isinstance(object, Mammal) and object.species == self.species
  </code></pre>
  <p>THE FOLLOWING TWO CLASSES NEED TO BE COMPLETED, AND YOU
  NEED TO REPLACE/DELETE ALL OF THE ELLIPSES SHOWN BELOW</p>
  <pre><code>class Hippo(Mammal):
     def __init__(self, name, species):
         self.name = name
         self.species = 'hippo'
     def getName(self):
         return self.name
     def setName(self, h):
         self.name = h
     def makeNoise(self):
         return 'grunting'
  
  class Elephant(Mammal):
     def __init__(self, name, species):
         self.name = name
         self.species = 'elephant'
     def getName(self):
         return self.name
     def setName(self, e):
         self.name = e
     def makeNoise(self):
         return 'trumpeting'
  
  class TestMammals(unittest.TestCase):
     &quot;&quot;&quot; a class that is derived from TestCase to allow for unit tests to run &quot;&quot;&quot;
  
     def testInheritance(self):
         &quot;&quot;&quot; confirm that Elephant and Hippo are children classes of Mammal &quot;&quot;&quot;
         self.assertTrue(issubclass(Elephant, Mammal) and issubclass(Hippo, Mammal))
  
  def testEqOperator(self):
         hip1 = Hippo('John')
         hip2 = Hippo('Arnold')
         self.assertEqual(hip1, hip2)
  def main():
     &quot;&quot;&quot; a 'main' function to keep program clean and organized &quot;&quot;&quot;
     print(&quot;-------------------- start main --------------------&quot;)
     e = Elephant(&quot;Ellie&quot;)
     h = Hippo(&quot;Henry&quot;)
     if(e == h):
        print(e.getName(), &quot;and&quot;, h.getName(), &quot;are of the same species&quot;)
     else:
        print(e.getName(), &quot;and&quot;, h.getName(), &quot;are *not* of the same species&quot;)
  
     def listenToMammal(Mammal):
        print(Mammal.makeNoise())
  
     listenToMammal(e)
     listenToMammal(h)
  
     e.eat(100)
     print(&quot;--------------------- end main ---------------------&quot;)
  if __name__ == &quot;__main__&quot;:
      main()
      unittest.main()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/M6kfi.png" rel="nofollow noreferrer">enter image description here</a>
  this is what the output should look like but im confused</p>