logo CodeStepByStep logo

window

Language/Type: Python constants for loops

Write a function named window that produces the preceding figure as output. Use for loops to print the repeated parts of the figure. Once you get it to work, use one constant named SIZE in your function so that the size of the figure can be changed simply by changing that constant's value. The example output shown is at a constant size of 3, but if you change the constant, the figure should grow larger and wider proportionally.

+===+===+
|   |   |
|   |   |
|   |   |
+===+===+
|   |   |
|   |   |
|   |   |
+===+===+

(Do not define the constant in your own code; we will define it in our testing code, and you should use it in your function.)

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.