input: Write a function that takes the definition of a Python class Vector3D and adds a method to normalize the vector. The normalize method should compute the vector's magnitude and then divide each component of the vector by this magnitude. The method should return a normalized Vector3D instance.
  
  class Vector3D:
      def __init__(self, x, y, z):
          self.x = x
          self.y = y
          self.z = z
      
      def __str__(self):
          return "(" + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + ")"
      
      def normalize(self):
          magnitude = (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5
          return Vector3D(self.x / magnitude, self.y / magnitude, self.z / magnitude)
  
  assert str(Vector3D(3, 4, 0).normalize()) == "(0.6, 0.8, 0.0)"
  assert str(Vector3D(1, 1, 1).normalize()) == "(0.5773502691896258, 0.5773502691896258, 0.5773502691896258)"
  assert str(Vector3D(0, 0, 0).normalize()) == "(0.0, 0.0, 0.0)"
  assert str(Vector3D(-2, -2, 2).normalize()) == "(-0.5773502691896258, -0.5773502691896258, 0.5773502691896258)"
output: def normalize(self):
      magnitude = (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5
      return Vector3D(self.x / magnitude, self.y / magnitude, self.z / magnitude)