title: failed to print the pattern as expected for a given positive integer n in python
body: <p>I wanted to print a particular pattern as shown below and for that, I created a list of lists with just <code>[1]</code> in it.</p>
  <p>Then I ran a for loop from <code>i= 2 to n</code> and in each iteration, I have added <code>[i]*(2i-3)</code> in top of the list as well as in the bottom.</p>
  <p>Then add <code>i</code> on both sides of all sub_lists.</p>
  <p>Below is the code i have used:</p>
  <pre><code>answer=[[1]]
  for i in range(2, n+1):
    t=[i]*((2*i)-3)
    answer.insert(0, t)
    answer.append(t)
    for a in answer:
      a.insert(0,i)
      a.append(i)
  
  answerfinal=[]
  
  print(len(answer))
  
  # we join the elements of the string without space
  for a in answer:
    answerfinal.append(''.join(map(str, a)))
  #print 
  for a in answerfinal:
      print(a)
  </code></pre>
  <p>I was supposing to get an answer like this, if input given is 4 :</p>
  <pre><code>4444444
  4333334
  4322234
  4321234
  4322234
  4333334
  4444444
  </code></pre>
  <p>But what I got is this:</p>
  <pre><code>444444444
  44333333344
  4433222223344
  4321234
  4433222223344
  44333333344
  444444444
  </code></pre>
  <p>Not sure where I was wrong.</p>