title: Python- How to print parallel lists/arrays, neatly, in two columns...?
body: <p>I will preface this by stating that I am a beginner and this is in regards to a homework assignment in an Intro to Programming class...</p>
  
  <p>I have two parallel lists of employee names and salaries, sorted by ascending salary in increments of thousands. I don't know how many elements will be in the list each time the program runs...it is determined by how many the user inputs each time.</p>
  
  <p>I am currently using the following code in a module to print my lists(represented by parameters 'S' and 'E' for salary and employee):</p>
  
  <pre><code>def printArrays(S, E):
  
      for i in S:
          idx = (S.index(i))
          print ("name:   " + E[idx] + "     salary:   $ %0.3f" % i)
  </code></pre>
  
  <hr>
  
  <p>the output from the above code looks like this:</p>
  
  <pre><code>name: Joe Smith     salary: $ 25.500
  name: Samantha Johnson     salary: $ 45.750
  name: Dan Pak     salary: $ 75.000
  </code></pre>
  
  <hr>
  
  <p>What I would like are neat columns that are not staggered. Better yet, I would like the output to look like this...</p>
  
  <pre><code>Employee name:     Salary:
  
  Joe Smith          $ 25.500
  Samantha Johnson   $ 45.750
  Dan Pak            $ 75.000
  </code></pre>
  
  <p>I appreciate any pointers. I have tried searching for how to print lists as columns and have had no luck in finding a simple solution. I can't use a dictionary because my results must remain sorted by salary value.
  TIA.</p>