title: How do you get a minimum value from a binary search tree
body: <p>I have created a Binary search class but i am struggling to create a minimum function to help find the smallest value in a binary tree. </p>
  
  <pre><code>class BinarySearchTree:
  
      def __init__(self, data):
          self.data = data
          self.left = None
          self.right = None
  
      def insert(self, new_data):
          if new_data == self.data:
              return
          elif new_data &lt; self.data:
              if self.left == None:
                  self.left = BinarySearchTree(new_data)
              else:
                  self.left.insert(new_data)
          else:
              if self.right == None:
                self.right = BinarySearchTree(new_data)
              else: 
                self.right.insert(new_data)
  
      def create_string(self,spaces):
          info = ' ' * spaces + str(self.data)
          if self.left != None:
              info += '\n(l)' + self.left.create_string(spaces + 4)
          if not self.right == None:
              info += '\n(r)' + self.right.create_string(spaces + 4)
          return info
  
      def __str__(self):
          representation = self.create_string(0)
          return representation
  
      def get_left(self):
          return self.left
  
      def get_right(self):
          return self.right
  
      def get_data(self):
          return self.data
  
  def minimum(tree):
      if tree.left:
          return minimum(tree.get_left)
      else:
          return tree.get_left
  </code></pre>
  
  <p>So i wrote the minimum function but for some reason it always returns a Nonetype error. Does anyone have an idea how to get_left on the binary tree until there are no more nodes</p>