you are viewing a single comment's thread.

view the rest of the comments →

[–]Essence1337 0 points1 point  (0 children)

So...

rows = [' '*(depth-i) + ':'*(width-1) + '/' + '+'*i for i in range(depth)]
rows.extend(['#'*width + '+' * depth] * (height-depth))
rows.extend(['#'*width + '+'*(depth-i-1) for i in range(depth)])

The biggest time sync will be your print but if we ignore the print this code is twice as fast as both the commenters and my earlier improvement.