title: Need Help solving a basic for loop
body: <p>Currently i have a program that finds coordinates makes them into lists and performs the dot product function on them, I have recently tried to add in a loop so that it runs through the program x amount of times performing the operation with all the coordinates, but I can't seem to get it to make it run through all the data and display all the answers, here is my code, it is very basic as I am a beginner programmer:</p>
  
  <pre><code>#!/usr/bin/python
  
  
  l=[]
  with open("coordinate_test") as f:
  line = f.next()
  nat = int(line.split()[0])
  print nat
  f.next()# skip headers
  for line in f:
      if line.strip():
          l.append(map(float,line.split()[1:]))  # make all values floats   
  #print l[0][0]
  
  a = 1
  for a in range(0,nat): 
  import operator
  import numpy as np
  vector1 = (int(l[0][0]),int(l[0][1]),int(l[0][2]))
  vector2 = (int(l[a][0]),int(l[a][1]),int(l[a][2]))
  #print vector1
  #print vector2
  x = vector1
  y = vector2
  vector3 = list(np.array(x) - np.array(y))
  #print vector3
  dotProduct = reduce( operator.add, map( operator.mul, vector3, vector3))
  print dotProduct
  a += 1
  print a
  </code></pre>