input: Write a function to remove all consecutive duplicate characters from a given string. Return the modified string with the consecutive duplicates removed.
  def remove_duplicates(string): 
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result
  
  assert remove_duplicates("AAABBCCCD") == "ABCD"
  assert remove_duplicates("ABBCDEEEEFFGGHHI") == "ABCDEFGHI"
  assert remove_duplicates("A") == "A"
  assert remove_duplicates("") == ""
  assert remove_duplicates("AAAAA") == "A"
output: def remove_duplicates(string): 
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result