input: Write a python function to replace a character at a specific index with an asterisk.
  assert replace_character("Hello world", 3) == "Hel*o world"
  assert replace_character("Python", 2) == "Py*hon"
  assert replace_character("OpenAI", 0) == "*penAI"
output: def replace_character(string, index):
      if index < 0 or index >= len(string):
          return string
      return string[:index] + '*' + string[index + 1:]