def sum_multiples(start, end, divisor):
  """
  >>> sum_multiples(1, 12, 4)
  24
  >>> sum_multiples(1, 12, 3)
  30
  """
  result = 0
  counter = start
  while counter <= end:
    if counter % divisor == 0:
      result += counter
    counter += 1
  return result