Problem statement:
We need to create a secret message in Python by mirroring a string. We will be given a string, first, we need to convert it to lowercase, then we need to find its mirror string. How? We need to break 26 alphabets into two half-equal parts, and place them above one another, now check what is the first letter of your string, check that letter in the two half parts of the alphabets, and find its mirror letter. Check the image below for a better understanding.
For example, for copyassignment, the output will be=> xlkbzhhrtmnvmg.

Code for Secret Message in Python:
# declaring a string mystr = 'CopyAssignment' #making mystr to lower case mystr = mystr.lower() # storing alphabets in two half parts, to be used for mirroring alphabets1 = 'abcdefghijklm' alphabets2 = 'zyxwvutsrqpon' # declaring a list to store new string letters strlist = [] # looping over string for i in mystr: # declaring a counter ctr = 0 if i in alphabets1: for j in alphabets1: if i==j: strlist.append(alphabets2[ctr]) else: ctr += 1 else: for j in alphabets2: if i==j: strlist.append(alphabets1[ctr]) else: ctr += 1 # printing the list by conerting it to string print(''.join(strlist))
Output:

Also Read:
- Hyphenate Letters in Python
- Earthquake in Python | Easy Calculation
- Striped Rectangle in Python
- Perpendicular Words in Python
- Composite Number in Python
- Greatest Among Four Numbers in Python
- Reverse the sentence in Python
- Denominations in Python
- Min and max values in an array in JavaScript
- Keyboard events in JavaScript
- Reaching Ground Floor in Python
- Number of Moves in Python
- Starks Adventure in Python
- Neutralization in Python | Assignment Expert
- Free shipping in Python
- Raj has ordered two electronic items Python | Assignment Expert
- First Place in Python
- Triples with Properties in Python
- Nested list Indexing Python
- Team Points in Python
- Two words combination in Python
- ID Card in Python
- Cipher with a key in Python | Assignment Expert
- Multiple of 5 in Python
- Sandglass Star in Python
- Multiple of 3 in Python | Assignment Expert
- Ticket selling in Cricket Stadium using Python | Assignment Expert
- Sum of List Elements in Python
- All possible subsets in Python
- Names and Nicknames in Python