A crate holds boxes, each box holds packs, each pack holds pencils. levels lists how many each layer holds, outside first, like [2, 3, 10]. Write pencils(levels) for the total: the first number times what the inner layers give. If levels is empty, that's just 1 pencil.
pencils([2, 3, 10])→60pencils([])→1def pencils(levels):
if levels == []:
return 1
# your code here: the first layer's number times the result for the inner layers (instead of return 0)
return 0
Run tries the examples. When they look right, Submit.