title: Modifying a matrix using nested list comprehensions in Python
body: <p>I am assigning values to a nested matrix in a traditional for loop.</p>
  <pre><code>    matrix= [[0 for j in range(3)]for i in range(3)]
      value = 10
      # Setting a value to a particular row in the matrix
      for i in range(3):
          if i == 2:
              for j in range(3):
                  matrix[i][j] = 10
      # Setting a value to a particular column in the matrix
      val  = 20
      for i in range(3):
          for j in range(3):
              if j == 1:
                  matrix[i][j] = 20
  </code></pre>
  <p>Can assigning of the values to the matrix be done in a nested list comprehension?
  I did try this :</p>
  <pre><code>                matrix = [[value for j in i if j == col ]for i in matrix]
  </code></pre>
  <p>But it isn't modifying the matrix, instead creates a new one.How can I accomplish this with nested list comprehensions?</p>