Question: Here is the code in a Python dictionary, where the keys are letters and the values are the corresponding Morse codes. morsecode = { '
Here is the code in a Python dictionary, where the keys are letters and the values are the corresponding Morse codes.
morsecode 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:
For example, the Morse code for 'a boy' is
We will adopt the convention that in the Morse code output there is always a space between two letters and there are three spaces between words. Write a function called morsemystring code that takes as input a string and a dictionary eg the Morse code dictionary above and returns the Morse code version of that string. You can cutandpaste the dictionary above into your function. For example:
morsea boy', morsecode
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
