Implement the following function. - Code should be in Python:
Morse Code:
code = {
'A': '.-',
'B': '-...',
'C': '-.-.',
'D': '-..',
'E': '.',
'F': '..-.',
'G': '--.',
'H': '....',
'I': '..',
'J': '.---',
'K': '-.-',
'L': '.-..',
'M': '--',
'N': '-.',
'O': '---',
'P': '.--.',
'Q': '--.-',
'R': '.-.',
'S': '...',
'T': '-',
'U': '..-',
'V': '...-',
'W': '.--',
'X': '-..-',
'Y': '-.--',
'Z': '--..',
}
Extracted text: morse(sentence): returns a string that is a conversion of sentence into Morse code . Morse code uses dots and dashes to represent letters. Letters in the same word must be separated by one space, different words will be separated by a slash surrounded by spaces (see examples below). You can assume that the sentence will only contain letters and spaces. There is no distinction between uppercase and lowercase letters. You will need to build a dictionary with each letter as a key and the Morse conversion as a value.