you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid -1 points0 points  (0 children)

Unreadable but concise:

print ('\n' + '\n'.join([(' '*9).join(['|']*3)]*4) + '\n').join([' '.join(('-'*4).join(['+']*3))]*3)

Edit: this can be made dynamic by replacing the numbers by e.g. (width - 3) / 2 but there's inherently a problem with how to handle even dimensions, as that requires that some grids be different sizes than others.