title: How do I convert .txt file to a list in python?
body: <p>I have a file called movies.txt and it contains a list of 1000 different movie titles. E.g</p>
  
  <pre><code>A Nous la Liberte (1932)    
  About Schmidt (2002)    
  Absence of Malice (1981)    
  Adam's Rib (1949)   
  ....
  ....
  </code></pre>
  
  <p>I would like to extract these movie titles in the .txt file and add them to a list in my python program but I am getting a type error. Here is my code.</p>
  
  <p>Note: <code>"File name: "</code> input is <code>'movies.txt'</code>.</p>
  
  <pre><code>file = open((input("File name: ")), "r")
  movies_list = file.readlines()
  movies_list = [movie.strip() for movie in movies_list]
  file.close()
  print(movies_list[0,1])
  </code></pre>
  
  <p>This is the error I get</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/liamemery/PycharmProjects/assignmenttwo/QuestionTwo.py", line 40, in &lt;module&gt;
      load()
    File "/Users/liamemery/PycharmProjects/assignmenttwo/QuestionTwo.py", line 6, in load
      print(movies_list[0,1])
  TypeError: list indices must be integers or slices, not tuple
  </code></pre>