input: 
  from typing import List
  
  def replace_characters(text: str, to_replace: str, replacement: str) -> str:
      """Replace all occurrences of a specified character in a given string with 
      the provided replacement character.
      
      >>> replace_characters("Hello World!", 'l', 'X')
      'HeXXXo WorXd!'
      >>> replace_characters("Mississippi", 's', 'z')
      'Mizzizzippi'
      """
      return text.replace(to_replace, replacement)
  
output:     for i in range(len(text)):
          if text[i] == to_replace:
              text = text[:i] + replacement + text[i+1:]
      return text