def treeLines(level): lines = 1 if level > 0: lines = lines + 2*treeLines(level-1) return lines