← Back to challenges

Making a Box

PythonHardstringsformatting

Instructions

Create a function that creates a box based on dimension n.

Examples

make_box(5) ➞ [
  "#####",
  "#   #",
  "#   #",
  "#   #",
  "#####"
]

make_box(3) ➞ [
  "###",
  "# #",
  "###"
]

make_box(2) ➞ [
  "##",
  "##"
]

make_box(1) ➞ [
  "#"
]

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.