input: def remove_duplicates(string): 
      result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result
  
  result = remove_duplicates("AAABBCCCD")
  print(result)
output:     result = "" 
      prev = '' 
  
      for char in string:
          if char != prev: 
              result += char
              prev = char
      return result