title: Function missing 2 required positional arguments: 'x' and 'y'
body: <p>I am trying to write a Python turtle program that draws a Spirograph and I keep getting this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\matt\Downloads\spirograph.py", line 36, in &lt;module&gt;
      main()
    File "C:\Users\matt\Downloads\spirograph.py", line 16, in main
      spirograph(R,r,p,x,y)
    File "C:\Users\matt\Downloads\spirograph.py", line 27, in spirograph
      spirograph(p-1, x,y)
  TypeError: spirograph() missing 2 required positional arguments: 'x' and 'y'
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>This is the code:</p>
  
  <pre><code>from turtle import *
  from math import *
  def main():
      p= int(input("enter p"))
      R=100
      r=4
      t=2*pi
      x= (R-r)*cos(t)-(r+p)*cos((R-r)/r*t)
      y= (R-r)*sin(t)-(r+p)*sin((R-r)/r*t)
      spirograph(R,r,p,x,y)
  
  
  def spirograph(R,r,p,x,y):
      R=100
      r=4
      t=2*pi
      x= (R-r)*cos(t)-(r+p)*cos((R-r)/r*t)
      y= (R-r)*sin(t)-(r+p)*sin((R-r)/r*t)
      while p&lt;100 and p&gt;10:
          goto(x,y)
          spirograph(p-1, x,y)
  
      if p&lt;10 or p&gt;100:
          print("invalid p value, enter value between 10 nd 100")
  
      input("hit enter to quite")
      bye()
  
  
  main()
  </code></pre>
  
  <p>I know this maybe has a simple solution but I really can't figure out what I am doing wrong, this was an exercise in my computer science 1 class and I have no idea how to fix the error.</p>