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
Get step-by-step solutions from verified subject matter experts
