+ 1
Morce code
As you can see this code can encode the word but it doesn't work for decoding. Can you suggest me a way to decode expect make a new list? https://code.sololearn.com/cw52tWH2fWH0/?ref=app
10 Respuestas
+ 4
I modified your code to use a `list` for storing encoded/decoded characters. It's then rather easy to glue the `list` elements into a string for display
Make functions for encoding & decoding, organize the code better, and reusable.
https://code.sololearn.com/cW9ldqmLfwzG/?ref=app
+ 3
The challenge in decoding a morse coded string is that morse code letters varies in length. So it's tricky unless we know ahead of time what character is used for morse code string delimiter.
+ 3
derived from Stackoverflow.
The suggestion is to tokenize the blank space to simplify the coding and decoding.
and because it's Python, there's a pip module for it...
https://code.sololearn.com/ccuz6gnzpdhI/?ref=app
https://code.sololearn.com/c0AuXQxs4vS1/?ref=app
+ 2
Ipang You are probably right. We must pay attention to the fact that each Morse code is separated from the next by a space. So it is possible. Maybe there is a command that can read the list in reverse, then it will be fixed
+ 2
The code takes input (regular input not in morse), encode each character into morse, print the encoding result <morce> glued as string.
The code then do the reverse, to decode <morce> into regular character in <result>, which is again, glued as string to output.
+ 2
sounds cool
+ 1
yo wass up
0
Ipang it can't decode the morse coade
0
It just prints morse code and words if I input the word
But if I input morse code it can't encode
0
Bob_Li good job bro
Good job
If these morses which you added are real