Question: USING PYTHON 3 Write a program that uses a dictionary to assign codes to each letter of alphabet. For example, code = {'A':')','a':'0','B':'(','b':'9','C':'*','c':'8', 'D':'&','d':'7','E':'^','e':'6','F':'%','f':'5', 'G':'$','g':'4','H':'#','h':'3','I':'@','i':'2',

USING PYTHON 3

Write a program that uses a dictionary to assign codes to each letter of alphabet. For example,

code = {'A':')','a':'0','B':'(','b':'9','C':'*','c':'8', 'D':'&','d':'7','E':'^','e':'6','F':'%','f':'5',\ 'G':'$','g':'4','H':'#','h':'3','I':'@','i':'2', 'J: !,'j':'1','K':'Z','k':'z','L':'Y','l':'y',\ 'M':'X','m':'x','N':'W','n':'w','O':'V','o':'v', 'P':'U','p':'u','Q':'T','q':'t','R':'S','r':'s',\ 'S':'R','s':'r','T':'Q','t':'q','U':'P','u':'p', 'V':'O','v':'o','W':'N','w':'n','X':'M','x':'m',\ 'Y':'L','y':'l','Z':'K','z':'k', '!':'J','1':'j', '@':'I','2':'i','#':'H','3':'h','$':'G','4':'g',\ '%':'F','5':'f','^':'E','6':'e','&':'D','7':'d', '*':'C','8':'c','(':'B','9':'b',')':'A','0':'a',\ ':':',',',':':','?':'.','.':'?','<':'>','>':'<', "'":'"','"':"'",'+':'-','-':'+','=':';',';':'=',\ '{':'[','[':'{','}':']',']':'}'}

Your program should open a specified text file, read its contents then use the dictionary to write an encrypted version of the files content to a second file. Each character in the second file should

contain the code for the corresponding character in the file.

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!