input: Write a function to remove all consecutive duplicates from a given string. Return the modified string as output. The function should iterate through each character in the string, appending it to the result only if it is different from the previous character. The result should be returned as a new 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("aabbbccaaa")=="abc"
  assert remove_duplicates("abcdd")=="abcd"
  assert remove_duplicates("112233")=="123"
  assert remove_duplicates("")==""
output: def remove_duplicates(string): 
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result