title: How to print the output of while loop in one line in python?
body: <p>It is a program to take input from user and print that iput in one line.
  when the user gives input 1,2,3,4
  the output that is every number come out in different line.</p>
  
  <p>that is after each iteration of loop output comes in new line but i want output to be in single line.How can i do it?
  but i want output
  1 2 3 4 5 
  how to get that output</p>
  
  <pre><code>print("Program to print a 1d array")
  array=[]
  i=0
  j=0
  while(i&lt;5):               ##whileloop1
      item=int(input())
      array.append(item)
      i=i+1
  while(j&lt;5):              ##whileloop2
      print(array[j])
      j=j+1
  </code></pre>