title: My code for this subtree max sum problem is currently not passing the test case listed below. What am I doing wrong?
body: <p>For whatever reason, my code for my total function looks right but my subtree sum function isn't working with this.</p>
  <pre><code>
  #total function: returns sum of leaves of a binary tree
  
  def total(t):
    if isinstance(t, int) or isinstance(t, float):
      return t
    else:
      return sum(total(i) for i in t)
  
  #max_subtree_total: returns maximum sum of subtree within binary tree
  
  def max_subtree_total(t):
      if isinstance(t, tuple):
        add = total(t)
        for i in t:
           subtotal = max_subtree_total(i)
        return max(subtotal, add)
      else:
        return t
  
  </code></pre>
  <p>Currently, not passing this test case:</p>
  <pre><code>check_equal(max_subtree_total((-3, -4)), -3)
  </code></pre>
  <pre><code>#check_equal function
  
  def check_equal(x, y, msg=None):
      if x == y:
          if msg is None:
              print(&quot;Success&quot;)
          else:
              print(msg, &quot;: Success&quot;)
      else:
          if msg is None:
              print(&quot;Error:&quot;)
          else:
              print(&quot;Error in&quot;, msg, &quot;:&quot;)
          print(&quot;    Your answer was:&quot;, x)
          print(&quot;    Correct answer: &quot;, y)
      assert x == y, &quot;%r and %r are different&quot; % (x, y)
  
  </code></pre>