Function to find height of a tree
def height ( root , ans ) : NEW_LINE INDENT if ( root == None ) : NEW_LINE INDENT return 0 NEW_LINE DEDENT left_height = height ( root . left , ans ) NEW_LINE right_height = height ( root . right , ans ) NEW_LINE DEDENT