title: accessing python list of list elements with only one index subscript
body: <p>So I have this function called <code>replace_elem</code>, written below:</p>
  
  <pre><code>def replace_elem(lst, index, elem):
      """Create and return a new list whose elements are the same as those in
      LST except at index INDEX, which should contain element ELEM instead.
  
      &gt;&gt;&gt; old = [1, 2, 3, 4, 5, 6, 7]
      &gt;&gt;&gt; new = replace_elem(old, 2, 8)
      &gt;&gt;&gt; new
      [1, 2, 8, 4, 5, 6, 7]
      &gt;&gt;&gt; new is old   # check that replace_elem outputs a new list
      False
      """
      assert index &gt;= 0 and index &lt; len(lst), 'Index is out of bounds'
      return [elem if i == lst[index] else i for i in lst]
  </code></pre>
  
  <p>I want to write this function below:</p>
  
  <pre><code>def put_piece(board, max_rows, column, player):
      """Puts PLAYER's piece in the bottommost empty spot in the given column of
      the board. Returns a tuple of two elements:
  
          1. The index of the row the piece ends up in, or -1 if the column
             is full.
          2. The new board
  
      &gt;&gt;&gt; rows, columns = 2, 2
      &gt;&gt;&gt; board = create_board(rows, columns)
      &gt;&gt;&gt; row, new_board = put_piece(board, rows, 0, 'X')
      &gt;&gt;&gt; row
      1
      &gt;&gt;&gt; row, new_board = put_piece(new_board, rows, 0, 'O')
      &gt;&gt;&gt; row
      0
      &gt;&gt;&gt; row, new_board = put_piece(new_board, rows, 0, 'X')
      &gt;&gt;&gt; row
      -1
      """
  </code></pre>
  
  <p>The hint was that I would use the <code>replace_elem</code> twice, but what I'm wondering is that <code>replace_elem</code> only takes in one index to give the location for what to replace so I'm curious as to how I could access lets say the first row and 3rd column index in python using only one subscript notation. Note I also have to return the whole board and not just the row</p>
  
  <p>This isn't homework but self study as the material for this course is posted online for free and course has finished.</p>