Please do not give solution in image format thanku Python3, while loop; Morse Code encodes text characters as a series of dots (.) and dashes (-) for transmission of information over low bandwidth (old!) mediums such as the original telegraph. Each character in the Morse alphabet is represented as a signature of dots and dashes. We wish to create a decoder that will extract a message from a Morse stream and convert it to readable text. There is an international standard that defines the current Morse code, but for our purposes, we will restrict ourselves to the small alphabet (defined below) but including the following control symbols: space between letters - one space like , space between words - three spaces like , and end of message - three hashes like ###. A = '.-' D = '-..' E = '.' F = '..--.' H = '....' I = '..' M = '--' N = '-.' O = '---' S = '...' T = '-' U = '..-' Y = '-.--' 1 = '.----' 2 = '..---' Your first mission is to write a decoder based on one or more while loops that can handle a message such as q9_input_i and create a string output9_i with the encoded message. Your second mission is to write an encoder, based on one or more while loops, that can encode a plain text message such as q9_input_ii built from the same alphabet and create a correct Morse representation stored in output9_ii. q9_input_i = "-.-- --- ..- ..--. .. -. .. ... .... . -.. .- .----###" q9_input_ii = "YOU MADE IT" # Write your solution here # YOUR CODE HERE
Please do not give solution in image format thanku
Python3, while loop;
Morse Code encodes text characters as a series of dots (.) and dashes (-) for transmission of information over low bandwidth (old!) mediums such as the original telegraph.
Each character in the Morse alphabet is represented as a signature of dots and dashes. We wish to create a decoder that will extract a message from a Morse stream and convert it to readable text. There is an international standard that defines the current Morse code, but for our purposes, we will restrict ourselves to the small alphabet (defined below) but including the following control symbols:
- space between letters - one space like ,
- space between words - three spaces like , and
- end of message - three hashes like ###.
A = '.-'
D = '-..'
E = '.'
F = '..--.'
H = '....'
I = '..'
M = '--'
N = '-.'
O = '---'
S = '...'
T = '-'
U = '..-'
Y = '-.--'
1 = '.----'
2 = '..---'
Your first mission is to write a decoder based on one or more while loops that can handle a message such as q9_input_i and create a string output9_i with the encoded message.
Your second mission is to write an encoder, based on one or more while loops, that can encode a plain text message such as q9_input_ii built from the same alphabet and create a correct Morse representation stored in output9_ii.
q9_input_i = "-.-- --- ..- ..--. .. -. .. ... .... . -.. .- .----###"
q9_input_ii = "YOU MADE IT"
# Write your solution here
# YOUR CODE HERE
Step by step
Solved in 3 steps with 3 images