Unable to understand TypeError
<p>Can someone please explain why I'm getting this error? My code:</p>

<pre><code>def x(n):
    if n == 1: n = 4
    elif n == 2: n = 3
    elif n == 3: n = 2
    elif n == 4: n = 1
    return n

def y(n):
    if n == 1: n = 2
    elif n == 2: n = 1
    elif n == 3: n = 4
    elif n == 4: n = 3
    return n

def query_x(i, j, quadrants):
    quadrants[i-1:j] = map(x, quadrants[i-1:j])

def query_y(i, j, quadrants):
    quadrants[i-1:j] = map(y, quadrants[i-1:j])

def query_c(i, j, quadrants):
    count = [quadrants[i-1:j].count(n) for n in range(1,5)]
    print "%d %d %d %d" % (count[0], count[1], count[2], count[3])

def process_queries(queries, quadrants):

    for query in queries:
        if   query[0] == "X": query_x(query[1], query[2], quadrants)
        elif query[0] == "Y": query_y(query[1], query[2], quadrants)
        elif query[0] == "C": query_c(query[1], query[2], quadrants)

if __name__ == "__main__":

    N = int(raw_input())

    quadrants = []
    for i in xrange(N):
        pair = map(int, raw_input().split())
        x, y = pair

        if   x &gt; 0 and y &gt; 0: quadrants.append(1)
        elif x &lt; 0 and y &gt; 0: quadrants.append(2)
        elif x &lt; 0 and y &lt; 0: quadrants.append(3)
        elif x &gt; 0 and y &lt; 0: quadrants.append(4)

    Q = int(raw_input())

    queries = []
    for i in xrange(Q):
        query = raw_input().split()
        queries.append([query[0], int(query[1]), int(query[2])])

    process_queries(queries, quadrants)
</code></pre>

<p>Output:</p>

<pre><code>4
1 1
-1 1
-1 -1
1 -1
5
C 1 4
X 2 4
C 3 4
Y 1 2
C 1 3
1 1 1 1
Traceback (most recent call last):
  File "QuadrantQueries_dev.py", line 53, in &lt;module&gt;
      process_queries(queries, quadrants)
  File "QuadrantQueries_dev.py", line 28, in process_queries
      if   query[0] == "X": query_x(query[1], query[2], quadrants)
  File "QuadrantQueries_dev.py", line 16, in query_x
      quadrants[i-1:j] = map(x, quadrants[i-1:j])
  TypeError: 'int' object is not callable
</code></pre>
