title: compare lists in python
body: <p>I have a text file, which looks like:</p>
  
  <pre><code>0010000110
  1111010111
  0000110111
  </code></pre>
  
  <p>I want to import them in python as list and then compare each element of the list to corresponding element in other list and do it for all combination of lists. If both of elements are 1, increase counter by 1 and in the end divide by the length of the list. I tried to write code, but it does not work as it should:</p>
  
  <pre><code>with open("D:/test/Vector.txt", "r") as f1:
     for a in f1:
        with open("D:/test/Vector.txt", "r") as f2:
           for b in f2:
              for i in range(10):
                  result = 0;
                  counter = 0;
                  if int(a[i]) == int(b[i]) == 1:
                      counter = counter+1
              result = counter / 10;
              print(a, b, result)
  </code></pre>
  
  <p>Edit: When creating text file with python, it moved every entry with \n on a new line, but I have no idea how to delete it.</p>
  
  <p>Expected output:</p>
  
  <pre><code>0010000110 0010000110 1
  0010000110 1111010111 0.3
  0010000110 0000110111 0.2
  1111010111 0010000110 0.3
  1111010111 1111010111 1
  1111010111 0000110111 0.4
  0000110111 0010000110 0.2
  0000110111 1111010111 0.4
  0000110111 0010000110 1
  </code></pre>