title: How do I print my square box correctly in the terminal?
body: <p>I am trying to draw a box with symbols on the terminal. The shape is created by a class object. I want to know how I could print my object dynamically.</p>
  <pre><code>class Box:
  
      def __init__(self, width, height):
          self.width = width
          self.height = height
  
      def draw_box(self):
          print('+ ' * self.width)
          for s in range(self.height-2):
              print('+ ', ' ' * (self.width-1), ' +')
          print('+ ' * self.width)
  
  
  # Create and Run code
  box = Box(5,4)
  box.draw_box()
  </code></pre>
  <p>But you can see below that the &quot;width&quot; coding of the box is broken. It was a little difficult to test because every time I changed the width and height arguments of my object, I would have to &quot;fix&quot; it to print correctly by either adding or subtracting a hard-coded number from or to <code>self.width</code>. The text are the <code>width</code> and <code>height</code> argument I tested for.</p>
  <pre><code>+ + + + + + + + + + + 
  +             + (11,7)
  +             +
  +             +
  +             +
  +             +
  + + + + + + + + + + + 
  &gt;&gt;&gt; #Bad output
  + + + + + (5,5)
  +       +
  +       +
  +       +
  + + + + +
  &gt;&gt;&gt; #Good output
  </code></pre>