input: Write a function to convert a given sentence to Morse code using the provided MORSE_CODE dictionary. The function should take a message as input and return the corresponding Morse code as output. If the input message contains any characters not in the MORSE_CODE dictionary, the function should handle them appropriately.
  def encode(message):
   code = ''
   for letter in message:
    if letter.upper() in MORSE_CODE:
     code += MORSE_CODE[letter.upper()] + ' '
    else:
     code += ' '
   
   return code
  
  assert encode("Hello world")==".... . .-.. .-.. ---  .-- --- .-. .-.. -.."
  assert encode("SOS")=="... --- ..."
  assert encode("123 ABC")==".---- ..--- ...--  .- -... -.-."
  assert encode("")==""
  assert encode("!?@#")=="..--.. --..--    "
output: def encode(message):
      code = ''
      for letter in message:
          if letter.upper() in MORSE_CODE:
              code += MORSE_CODE[letter.upper()] + ' '
          else:
              code += ' '
      
      return code