input: Write a function to create a class in Python that represents a complex number. The class should have an initializer to accept the real and imaginary parts of the complex number, and a `__str__` method to return the complex number in the format "(real + imaginaryi)".  
  
  class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)
  
  assert ComplexNumber(3, 4).__str__()=="(3 + 4i)"
  assert ComplexNumber(0, 0).__str__()=="(0 + 0i)"
  assert ComplexNumber(-1, -1).__str__()=="(-1 + -1i)"
  assert ComplexNumber(5, 0).__str__()=="(5 + 0i)"
  assert ComplexNumber(0, 7).__str__()=="(0 + 7i)"
output: class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)