Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started