title: nesting python list comprehensions to construct a list of lists
body: <p>I'm a python newb and am having trouble groking nested list comprehensions.  I'm trying to write some code to read in a  file and construct a list for each character for each line.</p>
  
  <p>so if the file contains</p>
  
  <pre><code>xxxcd
  cdcdjkhjasld
  asdasdxasda
  </code></pre>
  
  <p>The resulting list would be:</p>
  
  <p>[<br>
  ['x','x','x','c','d']<br>
  ['c','d','c','d','j','k','h','j','a','s','l','d']<br>
  ['a','s','d','a','s','d','x','a','s','d','a']<br>
  ]  </p>
  
  <p>I have written the following code, and it works, but I have a nagging feeling that I should be able to write a nested list comprehension to do this in fewer lines of code.  any suggestions would be appreciated.</p>
  
  <pre><code>data = []
  f = open(file,'r')
  for line in f:
      line = line.strip().upper()
      list = []
      for c in line:
          list.append(c)
      data.append(list)
  </code></pre>