I am trying to complete this homework assignment from Introduction to programming using Python.
It wants me to be able to use the up and down keys to increase and decrease speeds respectively. I have the start of the car(I still need to finish the shape), and I have a button to start and stop the car which work fine. However, when I try to run it using the example from the book(increaseSpeed and decreaseSpeed functions), it gives me "TypeError: increaseSpeed() takes 1 positional argument but 2 were given". I am not sure how to correct this in my code and it is beginning to frustrate me. The book doesn't even tell you why it used the sleepTime for increasing the speed of the message it originally used for the example.

```
from tkinter import *

class controlAnimation:
  def __init__(self):
    window = Tk()
    window.title("Racing Car")

    self.width = 250
    self.height = 100
    self.canvas = Canvas(window, bg="white", width=self.width, height=self.height)
    self.canvas.pack()
    frame = Frame(window)
    frame.pack()
    btStop = Button(frame, text = "Stop", command = self.stop)
    btStop.pack(side=LEFT)
    btStart = Button(frame, text = "Start", command = self.start)
    btStart.pack(side=RIGHT)
    self.x=0

    self.sleepTime = 100
    self.canvas.create_rectangle(self.x,90,self.x+60,80,fill="black", tags = "car")
    self.canvas.create_oval(self.x+10, 90, self.x+20, 100, fill = "black",tags = "car")

    self.dx=3
    self.isStopped = False
    self.animate()

    window.bind("<Up>", self.increaseSpeed)
    window.bind("<Down>", self.decreaseSpeed)
    window.mainloop()
  def stop(self):
    self.isStopped = True
  def start(self):
    self.isStopped = False
    self.animate()
  def increaseSpeed(self):
    if self.sleepTime>5:
    self.sleepTime-=20
  def decreaseSpeed(self):
    self.sleepTime+=20

  def animate(self): # Move the message 
     while not self.isStopped:
      self.canvas.move("car", self.dx,0) 
      self.canvas.after(self.sleepTime) 
      self.canvas.update() 
      if self.x < self.width:
          self.x += self.dx 
      else:
        self.x = 0 

        self.canvas.create_rectangle(self.x-60,90,self.x,80,fill="black", tags = "car")
        self.canvas.create_oval(self.x-50, 90, self.x-40, 100, fill = "black",tags = "car")
controlAnimation()    

```