input: Write a function to replace all occurrences of a character in a string with the provided replacement character. If the replacement character is not provided, the original character should remain unchanged.
  def replace_all_occurrences(str, char, replacement=None):
    return str.replace(char, replacement) if replacement else str
  
  assert replace_all_occurrences("Hello World!", 'l', 'X') == "HeXXo WorXd!"
  assert replace_all_occurrences("Hello World!", 'l') == "Hello World!"
  assert replace_all_occurrences("Hello World!", 'o', 'e') == "Helle Werld!"
  assert replace_all_occurrences("Hello World!", 'W', 'X') == "Hello Xorld!"
  assert replace_all_occurrences("", 'l', 'X') == ""
output: def replace_all_occurrences(str, char, replacement=None):
    return str.replace(char, replacement) if replacement else str