← Previous Next →

Draw N Squares

Created by Antoine Mazières

Instructions

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.

Your Code

Login to check your code and save your progress.