What does this mean? Why is it required? cur_row, cur_col = cur_path[-1] : <p>Im looking at some code for BFS traversal of maze in python. First time writing with python, I want to understand what the reason for cur_row, cur_col = cur_path[-1] is, specifically why [-1] is needed</p>

<pre><code>def bfs(maze):
    queue = []
    visited = set()
    queue.append([maze.getStart()])
    while queue:
        cur_path = queue.pop(0)
        cur_row, cur_col = cur_path[-1]
        if (cur_row, cur_col) in visited:
            continue
        visited.add((cur_row, cur_col))
        if maze.isObjective(cur_row, cur_col):
            return cur_path, len(visited)
        for item in maze.getNeighbors(cur_row, cur_col):
            if item not in visited:
                queue.append(cur_path + [item])
    return [], 0
</code></pre>
