title: Create list of lists from file python
body: <p>I'm new to python, I'm trying to create a list of lists from a text file. The task seems easy to do but I don't know why it's not working with my code. </p>
  
  <p>I have the following lines in my text file: </p>
  
  <pre><code>word1,word2,word3,word4
  word2,word3,word1
  word4,word5,word6
  </code></pre>
  
  <p>I want to get the following output: </p>
  
  <pre><code>[['word1','word2','word3','word4'],['word2','word3','word1'],['word4','word5','word6']]
  </code></pre>
  
  <p>The following is the code I tried: </p>
  
  <pre><code>mylist =[]
  list =[]
  with open("file.txt") as f:
      for line in f:
          mylist = line.strip().split(',')
          list.append(mylist)
  </code></pre>