Question: You have dictionary name codes. It has letters as keys and their equivalent codes as values. codes = { '1' : '[', '2' : '_',

You have dictionary name codes. It has letters as keys and their equivalent codes as values. codes = { '1' : '[', '2' : '_', '3' : ')', '4' : '}', '5' : ']', '6' : '{' } You are required to write a python program that has a function encryptMessage(String) that takes string (having following characters 1, 2, 3, 4, 5, 6) as an argument and returns an encrypted string using above dictionary. You can define and initialize the input string in the main function. Test data: Input string: 2156311 Encrypted: _[]{)[[

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!