Values by level

Write levels(root) that returns a list of lists: the values on each level of the tree from top to bottom, each level left to right. An empty tree gives [].

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

The point is to practise breadth-first traversal with a queue, one level at a time.

def levels(root):
    ...