input: Write a function that removes all consecutive duplicate characters from a given string. The function should return the modified string. If the input string is empty, the function should return an empty string.
  
  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("abbbccddeeff")=="abcdef"
  assert remove_duplicates("a")=="a"
  assert remove_duplicates("")=="" 
  assert remove_duplicates("abccba")=="abcba"
output: def remove_duplicates(string):
      result = ""
      prev = ''
  
      for char in string:
          if char != prev:
              result += char
              prev = char
      return result