title: Problems removing \n from a list
body: <p>I have looked up various solutions that make sense, and tried to implement them in my code.  When I print out the list I'm still receiving the number with a newline character.  Here is my code:</p>
  
  <pre><code>infile = open(r"C:\Users\rr205951\Documents\nums.txt", "r")
      numList = infile.readlines()
      print("Before: ", numList)
  
      for num in numList:
          num = num.rstrip('\n')
  
      print("After: ", numList)
  </code></pre>
  
  <p>When I run the above code it still returns this following:</p>
  
  <pre><code>Before:  ['15\n', '4\n', '3\n', '25\n', '2000\n', '328\n', '20\n', '9\n', '18\n', '4333\n']
  After:  ['15\n', '4\n', '3\n', '25\n', '2000\n', '328\n', '20\n', '9\n', '18\n', '4333\n']
  </code></pre>