Draw N Squares

Created by Antoine Mazières

You must provide the function draw_n_squares(n) that returns a string of squares, such as:

>>> from solution import draw_n_squares
>>> print(draw_n_squares(1))
+---+
|   |
+---+
>>> print(draw_n_squares(3))
+---+---+---+
|   |   |   |
+---+---+---+
|   |   |   |
+---+---+---+
|   |   |   |
+---+---+---+
>>> print(draw_n_squares(5))
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+

n is the number of squares on the diagonal.

There's no corrections yet, hit the `Submit` button to send your code to the correction bot.

Keyboard shortcuts:

  • Ctrl-Enter: Send your code to the correction bot.
  • Escape: Get back to the instructions tab.

See solutions