title: Making a hollow box in Python to these specifications?
body: <p>I'm to "Write a python program that prompts the user to input a positive integer n. The program then prints a hollow rectangle with n rows and 2*n columns. For a example an input of 3 would output:"</p>
  
  <pre><code>******
  *    *
  ******
  </code></pre>
  
  <p>And my code is:</p>
  
  <pre><code>n=int(input('Please enter a positive integer between 1 and 15: '))
  for col in range(n):
      for row in range(n):
          print('*' if col in(0,(2*n)+1) or row in(0,n+1) else ' ', end=' ')
      print()
  </code></pre>
  
  <p>But my output doesn't look at all like what I need; it's like the upper and left half of a hollow box. In addition, I'm not getting double columns like I need. What am I doing wrong?</p>
  
  <p>EDIT: Thank you everyone for your help! Gave me a lot of insight and was very helpful. I modified my code to the following, and it works very well:</p>
  
  <pre><code>&gt;n=int(input('Please enter a positive integer between 1 and 15: '))
  &gt;for row in range(n):
  &gt;    for col in range(2*n):
  &gt;        print('*' if row in(0,n-1) or col in(0,(2*n)-1) else ' ', end=' ')
  &gt;    print()
  </code></pre>
  
  <p>Special shout out to user2357112; you made me realize exactly what I had tripped up. </p>