title: Python - Read from text file and put into a list
body: <p>As title, I have been trying to read text from file, convert to <code>int</code> and store it in a list. My text file look like this:</p>
  
  <pre><code>1,2
  3,4
  5,6
  </code></pre>
  
  <p>I want to read this file, put each pair of numbers into a list <code>m</code>, and store those lists in a bigger list <code>lis</code>. Here is my attempt:</p>
  
  <pre><code>def read_file():        
      lis = []
      m = [0,0]
  
      with open("data.txt") as f:
          for line in f:
              m[0], m[1] = line.split(",")    # assign to list m
              m[0] = int(m[0])   # cut off '\n' and for later use
              m[1] = int(m[1])   
              lis.append(m)      # store in lis
  
      print lis
  </code></pre>
  
  <p>I expect the <code>lis</code> to be like this:</p>
  
  <pre><code>[[1, 2], [3, 4], [5, 6]]
  </code></pre>
  
  <p>But instead, it is:</p>
  
  <pre><code>[[5, 6], [5, 6], [5, 6]]
  </code></pre>
  
  <p>I have tried <code>insert</code> instead of <code>append</code> but it seems like that's not where it has problems. I need some help - thank you in advance!</p>