return height of tree
def heightoftree ( root ) : NEW_LINE INDENT if ( root == None ) : NEW_LINE INDENT return 0 ; NEW_LINE DEDENT left = heightoftree ( root . left ) ; NEW_LINE right = heightoftree ( root . right ) ; NEW_LINE return ( ( left if left > right else right ) + 1 ) ; NEW_LINE DEDENT