input: Write a function to convert a given sentence to Morse code using the predefined MORSE_CODE dictionary. For each character in the sentence, append the corresponding Morse code followed by a space. Return the resulting string of Morse code characters. If the sentence is empty, return an empty string.
  
  def encode(message):
   code = ''
   for letter in message:
    code += MORSE_CODE[letter.upper()] + ' '
   
   return code
  
  assert encode("Hello world") == ".... . .-.. .-.. ---  .-- --- .-. .-.. -.."
  assert encode("SOS") == "... --- ..."
  assert encode("123") == ".---- ..--- ...--"
  assert encode("") == ""
output: def encode(message):
      code = ''
      for letter in message:
          code += MORSE_CODE[letter.upper()] + ' '
      return code.strip()