title: How to have an accuracy for comparing 2 lists in python?
body: <p>I may not explain clearly.
  I want to have a comparing function to identify whether the values of the same index from 2 lists are the same or not.</p>
  
  <p>For example, 2 lists A and B, which should be the same(accuracy =100%).</p>
  
  <pre><code>A=[1,2,1,1,3,4,3,2,5]       
  B=[4,2,4,4,3,1,3,2,5]
  </code></pre>
  
  <p>since A(0),A(2),A(3) are the same value = 1,and B(0),B(2),B(3) are the same value = 4; A(1),A(7) are the same value = 2, the same as B(1),B(7);
  A(4),A(6) are the same value = 3, the same as B(4),B(6);
  A(5), unique value in list A, is the same as B(5); 
  A(8), unique value in list A, is the same as B(8).</p>
  
  <p>And then taking the same rule for list C &amp; D, which accuracy should be 80%.</p>
  
  <pre><code>C=[1,2,2,2,3,4,4,4,5,6]
  D=[3,4,4,4,1,5,5,6,5,6] 
  </code></pre>
  
  <p>D(7) should be the same value as D(5),D(6), not the same with D(9), and D(8) should not be the same value as D(5),D(6), which should be a standalone value.</p>
  
  <blockquote>
    <p>notice: the value in list may not be sequential number.  list A can
    also be [1,26,1,1,30,4,30,26,5], and B can be[4,22,4,4,3,100,3,22,5].
    Which I still take them to be the same.</p>
  </blockquote>
  
  <p>How can I have an accuracy of a comparing function to check it?
  Thanks!</p>