0

Can anyone help me with this....need the code in python

You are a secret agent, and you receive an encrypted message that needs to be decoded. The code that is being used flips the message backwards and inserts non-alphabetic characters in the message to make it hard to decipher. Task: Create a program that will take the encoded message, flip it around, remove any characters that are not a letter or a space, and output the hidden message. Input Format: A string of characters that represent the encoded message. Output Format: A string of character that represent the intended secret message. Sample Input: d89%l++5r19o7W *o=l645le9H

5th Nov 2021, 7:52 AM
Amrutha
Amrutha - avatar
2 Answers
+ 7
Based on the description of the encoding, it is obvious that expected output of the sample input is "Hello World". To do this in Python, just figure out how to flip a string, evaluate if the individual characters in the string is an alphabet or a space, and append those to the output string. Some built-in methods like isalpha() may help you achieve this. https://www.geeksforgeeks.org/python-string-isalpha-method/ You may also be interested in reversing a string. https://www.w3schools.com/python/python_howto_reverse_string.asp
5th Nov 2021, 8:11 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
You can check ascci table values to check if the input is a letter or not https://www.w3resource.com/JUMP_LINK__&&__python__&&__JUMP_LINK-exercises/python-basic-exercise-86.php Or use a built -in method such as isalpha() as mentioned above You can add your code to the post in order to get a better advice on how to make it functional
5th Nov 2021, 8:23 AM
Dareen Moughrabi
Dareen Moughrabi - avatar