title: Hi guys! I made a non iterate (able) function using turtle and key presses, and I can't call the function. How do I fix this?
body: <p>The first function calls to make the tic tac toe board, and the code before creates the screen and turtle.</p>
  <pre><code>        #import needed modules
           import turtle
          #make a screen
          ttts = turtle.Screen()
          #set up the pen
          d = turtle.Turtle()
          d.color(&quot;indigo&quot;)
          d.pensize(4)
          d.speed(5)
          d.penup()
          #make number list
          number_list = [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;]
          current_number = &quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;
          #set beginning position
          d.goto(-150,100)
          #make square (function)
          def square(*squares):
            squares = 0
            columns = 0
            rows = 0
            x = -75
            y = 100
            while (squares &lt; 4):
              d.pendown()
              d.forward(225)
              d.right(90)
              squares = squares + 1
            d.right(90)
            while (columns &lt; 2):
              d.goto(x,y)
              d.pendown()
              d.forward(225)
              d.penup()
              x = x + 75
              columns = columns + 1
            d.right(90)
            while (rows &lt; 3):
              d.goto(x,y)
              d.pendown()
              d.forward(225)
              d.penup()
              y = y + -75
              rows = rows + 1
          square()
  </code></pre>
  <p>This code above is fine, I have made sure to debug all the functions below as well. I'm just having trouble calling the functions at the end.</p>
  <pre><code>#make the numbers 
  def numbers():
    d.penup()
    d.color(&quot;yellow&quot;)
    d.goto(-120, 50)
    d.write(1, align='left', font = ('arial', 16))
    d.goto(-45, 50)
    d.write(2, align='left', font = ('arial', 16))
    d.goto(30, 50)
    d.write(3, align='left', font = ('arial', 16))
    d.goto(-120, -25)
    d.write(4, align='left', font = ('arial', 16))
    d.goto(-45, -25)
    d.write(5, align='left', font = ('arial', 16))
    d.goto(30, -25)
    d.write(6, align='left', font = ('arial', 16))
    d.goto(-120, -100)
    d.write(7, align='left', font = ('arial', 16))
    d.goto(-45, -100)
    d.write(8, align='left', font = ('arial', 16))
    d.goto(30, -100)
    d.write(9, align='left', font = ('arial', 16))
    d.hideturtle()
  numbers()
  #function for defining symbols(x and o)
  def draw_symbol(number_list): 
    number_list
    symbolc()
    symbolxs()
  #functions for x and o
  c = turtle.Turtle()
  xs = turtle.Turtle()
  def symbolc(circle):
    circle = 0
    def check_number_1():
        if (current_number == &quot;1&quot;):
          c.goto(-120,70)
    ttts.onkeypress(check_number_1, &quot;1&quot;)
    def check_number_2():
      if (current_number == &quot;2&quot;):
        c.goto(-45,70)
    ttts.onkeypress(check_number_2, &quot;2&quot;)
    def check_number_3():
      if (current_number == &quot;3&quot;):
        c.goto(30,70)
    ttts.onkeypress(check_number_3, &quot;3&quot;)
    def check_number_4():
      if (current_number == &quot;4&quot;):
        c.goto(-120,-5)
    ttts.onkeypress(check_number_4, &quot;4&quot;)
    def check_number_5():
      if (current_number == &quot;5&quot;):
        c.goto(-45,-5)
    ttts.onkeypress(check_number_5, &quot;5&quot;)
    def check_number_6():
      if (current_number == &quot;6&quot;):
        c.goto(30,-5)
    ttts.onkeypress(check_number_6, &quot;6&quot;)
    def check_number_7():
      if (current_number == &quot;7&quot;):
        c.goto(-120,-80)
    ttts.onkeypress(check_number_7, &quot;7&quot;)
    def check_number_8():
      if (current_number == &quot;8&quot;):
        c.goto(-45,-80)
    ttts.onkeypress(check_number_8, &quot;8&quot;)
    def check_number_9():
      if (current_number == &quot;9&quot;):
        c.goto(30,-80)
    ttts.onkeypress(check_number_9, &quot;9&quot;)
  #--- main ---
    if  (circle &lt; 1):
      c.penup()
      c.color(&quot;red&quot;)
      c.circle(20)
      circle = circle + 1
  #crosses
  def symbolxs(cross):
    cross = 0
    while (cross &lt; 4):
      def check_number_1():
        if (current_number == &quot;1&quot;):
          xs.goto(-120,70)
      ttts.onkeypress(check_number_1, &quot;1&quot;)
      def check_number_2():
        if (current_number == &quot;2&quot;):
          xs.goto(-45,70)
      ttts.onkeypress(check_number_2, &quot;2&quot;)
      def check_number_3():
        if (current_number == &quot;3&quot;):
          xs.goto(30,70)
      ttts.onkeypress(check_number_3, &quot;3&quot;)
      def check_number_4():
        if (current_number == &quot;4&quot;):
          xs.goto(-120,-5)
      ttts.onkeypress(check_number_4, &quot;4&quot;)
      def check_number_5():
        if (current_number == &quot;5&quot;):
          xs.goto(-45,-5)
      ttts.onkeypress(check_number_5, &quot;5&quot;)
      def check_number_6():
        if (current_number == &quot;6&quot;):
          xs.goto(30,-5)
      ttts.onkeypress(check_number_6, &quot;6&quot;)
      def check_number_7():
        if (current_number == &quot;7&quot;):
          xs.goto(-120,-80)
      ttts.onkeypress(check_number_7, &quot;7&quot;)
      def check_number_8():
        if (current_number == &quot;8&quot;):
          xs.goto(-45,-80)
      ttts.onkeypress(check_number_8, &quot;8&quot;)
      def check_number_9():
        if (current_number == &quot;9&quot;):
          xs.goto(30,-80)
      ttts.onkeypress(check_number_9, &quot;9&quot;)
      xs.penup()
      xs.color(&quot;lime&quot;)
      xs.right(45)
      xs.pendown()
      xs.forward(10)
      cross = cross + 1
  #turns - Circles goes first always. I hope you know how to play tic tac toe.
  c.stamp()
  xs.stamp()
  c.stamp()
  xs.stamp()
  c.stamp()
  xs.stamp()
  c.stamp()
  xs.stamp()
  c.stamp()
  ttts.listen()
  turtle.mainloop()
  </code></pre>
  <p>If you see an immediate error, please comment on enter code hereit. However, keep in mind that this is code made by a very young (early teen) student. Thanks a bunch!
  ps, sorry if the code looks bad on this. I do not know how to use this app, as it is my first question here. :)</p>