input: Write a python function to generate the fractal pattern string given a base fractal and a number of recursion levels. 
  assert generate_fractal_string("FX", 1) == "FX+YF+"
  assert generate_fractal_string("FX", 2) == "FX+YF++-FX-YF+"
  assert generate_fractal_string("FX", 3) == "FX+YF++-FX-YF++-FX+YF+F++-FX-YF+"
  assert generate_fractal_string("FX", 0) == "FX"
output: def generate_fractal_string(base, levels):
      def replace_characters(s):
          return s.replace("X", "X+YF+").replace("Y", "-FX-Y")
  
      result = base
      for _ in range(levels):
          result = replace_characters(result)
      return result