title: Processing csv in Python lists using lists and for loops
body: <p>I have a csv I am reading from and am making 4 lists from the first 4 columns of that csv. </p>
  
  <pre><code>listofcelebs = (columns['name'])
  listOfImages = (columns['image'])
  listOfProfessions = (columns['profession'])
  listOfBestWork = (columns['bestWork'])
  </code></pre>
  
  <p>I only need to read the items from the first list to run a twitter sentiment analysis on each item and print out the result. However I would like to print out the other lists inbetween as well.</p>
  
  <p>How could I print out</p>
  
  <p>the the first item of the list listofcelebs, </p>
  
  <p>then the first item of list listOfImages, </p>
  
  <p>then the first item of list listOfProfessions,</p>
  
  <p>then the first item of list listOfBestWork, </p>
  
  <p>then the result of the twitter sentiment analysis on the first item of list listofcelebs, </p>
  
  <p>a sperator ie. "--------------------------------------------------------------------- \n  "</p>
  
  <p>then the the second item of the list listofcelebs,</p>
  
  <p>then the first item of list listOfImages, </p>
  
  <p>etc. etc.</p>
  
  <p>In the end I store the results in a new csv with the headings [name,image,profession,bestWork,overallSentiment])</p>
  
  <hr>
  
  <p>Here is my code currently gives the error incorrect indentation</p>
  
  <pre><code>import csv
  import twittersearch
  from collections import defaultdict
  
  c = csv.writer(open("celebritiesBornTodayWithSentiment.csv", "wb"))
  columns = defaultdict(list) # each value in each column is appended to a list
  
  with open('celebritiesBornToday.csv') as f:
      reader = csv.DictReader(f) # read rows into a dictionary format
      for row in reader: # read a row as {column1: value1, column2: value2,...}
          for (k,v) in row.items(): # go over each column name and value 
              columns[k].append(v) # append the value into the appropriate list
                                   # based on column name k
  
  listofcelebs = (columns['name'])
  listOfImages = (columns['image'])
  listOfProfessions = (columns['profession'])
  listOfBestWork = (columns['bestWork'])
  
  zippedListofCelebInfo = zip(listOfNames, listOfImages, listOfProfessions, listOfBestWork)
  
  #giving headings to the columns of the final csv file
  c.writerow(['name','image','profession','bestWork','overallSentiment'])
  
  
  for name in zippedListofCelebInfo:
      #Printing the Name of the Celebrity
      print "Name of the celebrity: "+name
  
      #Printing the Image of the Celebrity
      print "Image: "+image
  
      #Printing the Profession of the Celebrity
      print "Profession: "+profession
  
      #Printing the BestWork of the Celebrity
      print "BestWork: "+bestWork
  
      #calling twittersearch2 from the other file to derive tweet sentiment, celebrity's full name used as the query
      overallSentiment = twittersearch.twittersearch2(name)
      print "Overall Sentiment on Twitter : "+overallSentiment
  
       # End of Celebrity Details
      print "--------------------------------------------------------------------- \n  "
  
      #saving the name, image, profession, bestWork, overallSentiment of the celebrity into a csv file
      c.writerow([name,image,profession,bestWork,overallSentiment])
  </code></pre>