title: Is there a way through which I can append the new list into the existing list on each while iteration?
body: <p>**Can someone please help me with a better way of doing it?</p>
  <blockquote>
  <p>This is my output.The user has to input whether he has a new process to enter if yes then enter new process and it must get appended to a new list.But in my case after every new iteration of while it gets appended to the first list instead.</p>
  </blockquote>
  <hr />
  <pre><code>Enter process name: 1
  Enter process Arrival Time: 3
  Enter Execution Time: 2
  
  [['1', 3, 2]]
  Enter process name: 2
  Enter process Arrival Time: 4
  Enter Execution Time: 3
  
  [['1', 3, 2], ['2', 4, 3]]
  enter new processy
  ENTER TOTAL NUMBER OF PROCESSES: 1
  Enter process name: 3
  Enter process Arrival Time: 2
  Enter Execution Time: 3
  
  [['1', 3, 2, '3', 2, 3], ['2', 4, 3], []]
  enter new process
  
  ----------------------------------------------
  &gt;This is my code 
  
  a = 0
  #p = [['p1', 0, 2], ['p2', 1, 2], ['p3', 5, 3], ['p4', 6, 4]]
  a2 = [0]
  completion_time=[]
  pp = []
  tat=[]
  waiting_time=[]
  p = []
  total_wtime = 0
  n=0
  
  def addnew():
      n = int(input('ENTER TOTAL NUMBER OF PROCESSES: '))
      for i in range(n):
          p.append([])
          p[i].append(input('Enter process name: '))
          p[i].append(int(input('Enter process Arrival Time: ')))
  
          p[i].append(int(input('Enter Execution Time: ')))
          print('')
          print(p)
  
  ans=&quot;y&quot;
  while(ans==&quot;y&quot;):
      addnew()
      ans = input(&quot;enter new process&quot;)
  </code></pre>