title: Python Tree data structure, TypeError
body: <p>The code is written is meant to calculate the number of nodes in a tree. However, I am getting a simple type error that keeps referring back to my TreeNode class. I have checked for spellings and typos, but I still can't find the error. Please help</p>
  
  <h2>Here is the error</h2>
  
  <pre><code>    Traceback (most recent call last):
    File "C:/Users/Eli/.PyCharmCE2019.2/config/scratches/Tree.py", line 30, in &lt;module&gt;
      t1.addChild(t1.Root(),6)
  TypeError: 'TreeNode' object is not callable
  </code></pre>
  
  <hr>
  
  <pre><code>class TreeNode():
      def __init__(self, data= None, parent = None):
          self.data = data
          self.children = []
          self.parent = parent
  class Tree():
      def __init__(self):
          self.Root = None
          self.size = 0
      def __len__(self):
          return self.size
      def root (self):
          return self.Root
      def children (self, node):
          return node.children()
      def addChild (self,parent,data):
          t = TreeNode (data,parent)
          if parent == None:
              self.Root = t
          else:
              parent.children.append(t)
          self.size +=1
      def printTreePreOrder(self,node):
          print(node.data)
          for n in node.children:
              self.printTreePreOrder(n)
  if __name__ == "__main__":
      t1 = Tree()
      t1.addChild(None,5)
      t1.addChild(t1.Root(),6)
  
      cl = t1.children(t1.Root())
      for n in cl:
          t1.addChild(n,3)
          t1.addChild(n,9)
      t1.printTreePr
  </code></pre>