Download the Program_1.py and Program_2.py files and save it.
Place the “character_mapping.txt” and “word_corpus.txt” file in the same folder or edit the base path in the programs to the location and then compile and run it using any python3 compiler without any command line arguments.
When the second task program is running for the input, multiline input is supported in this program. After the last input press enter and Ctrl-D or Ctrl-Z (windows) for ending the input loop.
Results have been saved in the file name Result.txt for the inputs.
Programs tested using command line Python3 installed in Ubuntu 18.04.2 LTS.