title: compare two text files in python
body: <p>I'm trying to compare to text files and output the same in third one , but it does not work
  the two files have six rows
  ,the first one is like this </p>
  
  <pre><code>name 50 60 77 88
  name 33 55 76 45
  name 22 43 65 87
  name 44 65 87 90
  name 54 07 67 08
  </code></pre>
  
  <p>the second is like</p>
  
  <pre><code>name 77 32.88
  name 86  66.9
  name 55  34.8
  name 34  88.9
  name 42  77.6
  name 22  65.9
  </code></pre>
  
  <p>i want to match the names to get the other information</p>
  
  <p>here is what I did</p>
  
  <pre><code>file1 = open("file1.txt", "r")
  file2 = open("file2.txt", "r")
  file3 = open("resultss.txt", "w")
  list1 = file1.readlines()
  list2 = file2.readlines()
  file3.write("here: \n")
  for i in list1:
      for j in list2:
          if  i==j:
              file3.write(i)
  </code></pre>