title: Calculating height of a binary tree
body: <p>I tried to implement a method to calculate height of a binary tree by creating a method internal to the binary tree class. It is showing the error None Type object doesn't have attribute height.
  here is the code:</p>
  
  <pre><code>def height(self):
      if self==None:
          return 0
      else :
  
              lheight=self.leftChild.height() 
  
              rheight=self.rightChild.height() 
  
              if lheight&gt;rheight:
                  return lheight+1
              else:
                  return rheight+1
  </code></pre>