input: Write a function to create a class in Python that can store and process data in a Car object. The class should have an initializer to store the make, model, color, and mileage of the car, as well as methods to accelerate and decelerate the car.
  
  
  class Car:
      def __init__(self, make, model, color, mileage):
          self.make = make
          self.model = model
          self.color = color
          self.mileage = mileage
  
      def accelerate(self, speed):
          self.speed = speed
  
      def decelerate(self, speed):
          self.speed = speed
  
  # Test cases
  car1 = Car("Toyota", "Corolla", "Red", 50000)
  car1.accelerate(60)
  car1.decelerate(40)
  
  car2 = Car("Honda", "Civic", "Blue", 30000)
  car2.accelerate(50)
  car2.decelerate(30)
  
  car3 = Car("Ford", "Mustang", "Black", 20000)
  car3.accelerate(70)
  car3.decelerate(50)
  
  
  The function successfully creates a Car class with the required attributes and methods.
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
  