def repeat(s, exclaim):
  """
  Returns the string 's' repeated 3 times.
  If exclaim is true, add exclamation marks.
  """
  
  result = s + s + s
  
  if exclaim:
    result += "!!!"

  return result