Question: Morse Code Morse Code uses a series of short and long pulses, dots and dashes, respectively, to encode letters and digits. For example, the letter
Morse Code
Morse Code uses a series of short and long pulses, dots and dashes, respectively, to encode letters and digits. For example, the letter is is
ignore the spaces in between dashes and dots.
Use the provided Morse Code file to create a dictionary for mapping characters and digits to Morse Code. Consider using relative file path.
Use the dictionary to create a program that can translate between Morse Code and characters and digits.
Your program should ask the user if they would like to enter Text or Morse Code. Based on user' choice and their input, translate the input between
Morse Code and characters and digits.
Note:
Name the program morse code,py
Include docstrings for the program and any function you create.
To ensure the correctness of each function, consider including doctests in the docstring.
Example Outputs:
Translate from text to Morse Code
This program tanslates text to Morse Code or translates Morse Code to text.
Is your input text or Morse Code?
Enter for text or for Morse Code.
My input is: T
Please enter text to translate: Welcome to CS
Thanks for using this program!
Press Esc key to quit...
Translate from Morse Code to text
This program tanslates text to Morse Code or translates Morse Code to text.
Is your input text or Morse Code?
Enter for text or for Morse Code.
Hy input is: Morse
Invalid command.
Hy input is:
please enter morse to translate:
hi
Thanks for using this program!
Press Esc key to quit...
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
