input: Write a function to create a Car class in Python that initializes with make, model, color, and mileage, and provides methods to accelerate and decelerate. The accelerate method should accept speed as a parameter and set the speed attribute of the Car instance. The decelerate method should also accept speed as a parameter and set the speed attribute of the Car instance.
  class Car:
      def __init__(self, make, model, color, mileage):
          self.make = make
          self.model = model
          self.color = color
          self.mileage = mileage
          self.speed = 0
  
      def accelerate(self, speed):
          self.speed = speed
  
      def decelerate(self, speed):
          self.speed = speed
  
  assert Car("Toyota", "Corolla", "Red", 50000).make == "Toyota"
  assert Car("Honda", "Civic", "Blue", 30000).model == "Civic"
  assert Car("Ford", "Mustang", "Black", 10000).color == "Black"
  assert Car("BMW", "X5", "White", 20000).mileage == 20000
  c = Car("Tesla", "Model S", "Gray", 5000)
  c.accelerate(100)
  assert c.speed == 100
  c.decelerate(20)
  assert c.speed == 20
output: class Car:
      def __init__(self, make, model, color, mileage):
          self.make = make
          self.model = model
          self.color = color
          self.mileage = mileage
          self.speed = 0
  
      def accelerate(self, speed):
          self.speed = speed
  
      def decelerate(self, speed):
          self.speed = speed