title: Python: convert str to integer
body: <p>I'm new at Python and I have an assginment which is read a file and convert it to matrix. My file is:</p>
  
  <pre><code>n 5
  0 -- 3
  0 -- 4
  1 -- 2
  1 -- 3
  2 -- 4
  3 -- 3
  </code></pre>
  
  <p>First of all,I have to make a "5X5" matrix.
  I read 5 like this:</p>
  
  <pre><code>f = open("graph.txt")
      mylist = f.readlines()
      a = mylist[0][2]
  </code></pre>
  
  <p>When say <code>print a</code> it prints 5. In order to make a matrix I need to convert this string to integer. However, when I used <code>int(a)</code> function, it remained a <code>str</code>. How can I change it to integer permanently?</p>