Question: Write a Python program that reads from the keyboard a word and displays the encrypted version of that word. Assume that only the characters (A,

Write a Python program that reads from the keyboard a word and displays the encrypted version of that word. Assume that only the characters (A, D, I, R, Y ) are allowed in the input word and that the encoding is as shown in the following table:

Character A D I R Y
Encoded M N A B T

For example the word RIYAID will be encoded as BATMAN.

You need to use three functions, readWord(), encrypt() and displayEncryption().

readWord() is called by main() to read from the keyboard 6 characters.

encrypt() is called by main() to convert the characters obtained from readWord() into corresponding encryptions as indicated in the table.

displayEncryption() is called by main() to display the encrypted word on the screen.

Notes:

1. Your program should check the validity of the user input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!