input: 
  from typing import List
  
  def remove_duplicates(string: str) -> str:
      """ Remove all consecutive duplicates from the given string.
      >>> remove_duplicates("AAABBCCCD")
      'ABCD'
      >>> remove_duplicates("A")
      'A'
      >>> remove_duplicates("")
      ''
      >>> remove_duplicates("AA")
      'A'
      >>> remove_duplicates("AABBCC")
      'ABC'
      """
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result
  
  
output:     
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result
  