Height of a tree

Write height(root) that returns the number of nodes on the longest path from the root down to a leaf. An empty tree (None) has height 0; a single node has height 1. root is a TreeNode with val, left and right.

height([8, 3, 10, 1, 6, None, 14])  ->  3
height([1])                         ->  1
height(None)                        ->  0

The point is to practise recursion on trees.

def height(root):
    ...